-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
bpo-24334: Cleanup SSLSocket #5252
Conversation
4ce6638
to
76b519c
Compare
Modules/_ssl.c
Outdated
@@ -2309,19 +2323,21 @@ _ssl._SSLSocket.shutdown | |||
|
|||
Does the SSL shutdown handshake with the remote end. | |||
|
|||
Returns the underlying socket object. | |||
Mode 0 is quiet shutdown, which does not send any CLOSE NOTIFY. Mode 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do "mode 0" and "mode 2" refer to?
Lib/ssl.py
Outdated
return self._sslobj.pending() | ||
else: | ||
return 0 | ||
|
||
def shutdown(self, how): | ||
self._checkClosed() | ||
self._sslobj = None | ||
if self._sslobj is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure the redundancy adds something here?
76b519c
to
7f303a7
Compare
@pitrou I have addressed your review comments. Both places are remnants of another patch to implement more shutdown methods. I have removed them from this PR. https://bugs.python.org/issue27815#msg310403 explains the additional shutdown methods. I decided to move new shutdown methods to another PR and get this PR out before beta1. |
7f303a7
to
2a4f5d2
Compare
2a4f5d2
to
f4af45c
Compare
* The SSLSocket is no longer implemented on top of SSLObject to avoid an extra level of indirection. * Owner and session are now handled in the internal constructor. * _ssl._SSLSocket now uses the same method names as SSLSocket and SSLObject. * Channel binding type check is now handled in C code. Channel binding is always available. The patch also changes the signature of SSLObject.__init__(). In my opinion it's fine. A SSLObject is not a user-constructable object. SSLContext.wrap_bio() is the only valid factory.
f4af45c
to
9a5cfc5
Compare
Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
@tiran: Please replace |
* The SSLSocket is no longer implemented on top of SSLObject to avoid an extra level of indirection. * Owner and session are now handled in the internal constructor. * _ssl._SSLSocket now uses the same method names as SSLSocket and SSLObject. * Channel binding type check is now handled in C code. Channel binding is always available. The patch also changes the signature of SSLObject.__init__(). In my opinion it's fine. A SSLObject is not a user-constructable object. SSLContext.wrap_bio() is the only valid factory. (cherry picked from commit 141c5e8) Co-authored-by: Christian Heimes <[email protected]>
GH-5857 is a backport of this pull request to the 3.7 branch. |
* The SSLSocket is no longer implemented on top of SSLObject to avoid an extra level of indirection. * Owner and session are now handled in the internal constructor. * _ssl._SSLSocket now uses the same method names as SSLSocket and SSLObject. * Channel binding type check is now handled in C code. Channel binding is always available. The patch also changes the signature of SSLObject.__init__(). In my opinion it's fine. A SSLObject is not a user-constructable object. SSLContext.wrap_bio() is the only valid factory. (cherry picked from commit 141c5e8) Co-authored-by: Christian Heimes <[email protected]>
avoid an extra level of indirection.
SSLObject.
is always available.
The patch also changes the signature of SSLObject.init(). In my
opinion it's fine. A SSLObject is not a user-constructable object.
SSLContext.wrap_bio() is the only valid factory.
https://bugs.python.org/issue24334