Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

Disable do_handshake_on_connect in ssl.wrap_socket #106

Open
pquentin opened this issue Aug 17, 2019 · 3 comments
Open

Disable do_handshake_on_connect in ssl.wrap_socket #106

pquentin opened this issue Aug 17, 2019 · 3 comments

Comments

@pquentin
Copy link
Member

Python 2.x and Python 3.x have this attribute in ssl.wrap_socket called do_handshake_on_connect: https://docs.python.org/3/library/ssl.html#ssl.wrap_socket:

The parameter do_handshake_on_connect specifies whether to do the SSL handshake automatically after doing a socket.connect(), or whether the application program will call it explicitly, by invoking the SSLSocket.do_handshake() method. Calling SSLSocket.do_handshake() explicitly gives the program control over the blocking behavior of the socket I/O involved in the handshake.

It's enabled by default, but we probably want to disable it to avoid having uncontrolled blocking I/O? I'm still fuzzy on the details here.

@njsmith
Copy link
Member

njsmith commented Aug 17, 2019

This is only relevant for sync mode, so blocking I/O isn't necessarily a problem. We do need to impose a timeout somehow. I think for ssl in blocking mode, the do_handshake still respects any timeout set with wrapped_sock.set_timeout(...)?

@pquentin
Copy link
Member Author

Ah you're right, that's much less important than I thought it was. I'll see if the timeout applies, and then close this issue if it does.

@sethmlarson
Copy link
Contributor

@pquentin is this resolved since ssl+blocking respects the socket's timeout?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants