[openssl-users] porting socket ssl python to c++

Roberto Spadim roberto at spadim.com.br
Wed Aug 1 17:51:35 UTC 2018


hi guys, i'm with a newbie question


i have this piece of code, but i'm not finding something similar with c++,
could anyone help? thanks:


import socket
import ssl
import sys
if len(sys.argv) == 3:
   HOST = sys.argv[1]     # IP
   PORT = int(sys.argv[2])  # Port
else:
   print "USAGE: $python client_ssl.py <server_ip> <port>"
   exit(1)
print 'Connecting...'
s = socket.create_connection((HOST, PORT))
s = ssl.wrap_socket(s)
print "Connected!\n"
while True:
   query = raw_input("Query: ")
   if ( query == "quit" ):
      break
   s.send(query)
   data = s.recv(16384)
   print 'Reply:', data
s.close()




-- 
Roberto Spadim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20180801/c8719fc1/attachment.html>


More information about the openssl-users mailing list