Click here to Skip to main content
15,887,585 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am trying to write a tls server over non blocking socket in python.

my code snippet:
Python
newsocket, fromaddr = bindsocket.accept()
newsocket.setblocking(0)
connstream = ssl.wrap_socket(newsocket,
                             server_side=True,
                             certfile="cert.pem",
                             keyfile="key.pem",
                             ssl_version=ssl.PROTOCOL_TLSv1)


wrap_socket fails with want read/write. as per documentation (python ssl) i need to call do_handshake() on connstream but the trouble is connstream is not returned so cant call do_handshake() on it.

What is the best and fastest way to accept tls connection?
Posted
Comments
Member 4686590 5-Jan-16 1:44am    
hmm.. no response.. not even a question!!... is the question not clear or am i missing something obvious?

1 solution

Take a look at Gevent module, it is designed for non blocking.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900