New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSL support for asyncore #54293
Comments
It might be useful to make public the SSL support for asyncore which is currently implemented in various tests. |
(I'm posting this issue after having read this message: |
Problem with SSL dispatcher subclasses used in tests is that they are all similar to pyftpdlib's SSLConnection class ( http://code.google.com/p/pyftpdlib/source/browse/trunk/pyftpdlib/contrib/handlers.py?spec=svn743&r=729#73 ) and I'm not sure it's API is suitable for a general use case. |
Initial draft of a patch including tests and a new ssl_dispatcher subclass. |
First comments:
SSL_ERROR_SSL doesn't exist. Perhaps you mean ssl.SSL_ERROR_EOF? - in send(), you should handle SSL_ERROR_WANT_READ and
SSL_ERROR_WANT_WRITE as in recv(). Also:
+ if err.args[0] in (ssl.SSL_ERROR_EOF, ssl.SSL_ERROR_ZERO_RETURN):
+ return 0 lacks a self.handle_close()?
ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
ssl_context.verify_mode = ssl.CERT_REQUIRED
cert_path = os.path.join(os.path.dirname(__file__), "keycert.pem")
ssl_context.load_cert_chain(cert_path)
ssl_context.load_verify_locations(cert_path)
(also, I'm not sure why these tests can't be shared with non-SSL test
|
asyncore module has been deprecated as per https://docs.python.org/3/library/asyncore.html: <<This module exists for backwards compatibility only. For new code we recommend using asyncio.>> Closing this out as won't fix. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: