Issue #16357: fix calling accept() on a SSLSocket created through SSLContext.wrap_socket().

Original patch by Jeff McNeil.
This commit is contained in:
Antoine Pitrou 2012-11-11 01:27:33 +01:00
commit 73e9bd4d25
3 changed files with 44 additions and 10 deletions

View file

@ -553,16 +553,11 @@ class SSLSocket(socket):
SSL channel, and the address of the remote client."""
newsock, addr = socket.accept(self)
return (SSLSocket(sock=newsock,
keyfile=self.keyfile, certfile=self.certfile,
server_side=True,
cert_reqs=self.cert_reqs,
ssl_version=self.ssl_version,
ca_certs=self.ca_certs,
ciphers=self.ciphers,
do_handshake_on_connect=
self.do_handshake_on_connect),
addr)
newsock = self.context.wrap_socket(newsock,
do_handshake_on_connect=self.do_handshake_on_connect,
suppress_ragged_eofs=self.suppress_ragged_eofs,
server_side=True)
return newsock, addr
def get_channel_binding(self, cb_type="tls-unique"):
"""Get channel binding data for current connection. Raise ValueError