Kaydet (Commit) 873bf262 authored tarafından Antoine Pitrou's avatar Antoine Pitrou

Update example of non-blocking SSL code for the new finer-grained exceptions

üst 41032a69
......@@ -1044,13 +1044,10 @@ to be aware of:
try:
sock.do_handshake()
break
except ssl.SSLError as err:
if err.args[0] == ssl.SSL_ERROR_WANT_READ:
select.select([sock], [], [])
elif err.args[0] == ssl.SSL_ERROR_WANT_WRITE:
select.select([], [sock], [])
else:
raise
except ssl.SSLWantReadError:
select.select([sock], [], [])
except ssl.SSLWantWriteError:
select.select([], [sock], [])
.. _ssl-security:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment