Commit 12cb296c authored by Jason Madden's avatar Jason Madden

Handle SSLEOFError during sock.unwrap() from versions of Python with...

Handle SSLEOFError during sock.unwrap() from versions of Python with https://bugs.python.org/issue31122

The unpinned 3.9-dev build caught this.
parent 7b431126
...@@ -42,6 +42,7 @@ from socket import SOL_SOCKET ...@@ -42,6 +42,7 @@ from socket import SOL_SOCKET
from ssl import SSLWantReadError from ssl import SSLWantReadError
from ssl import SSLWantWriteError from ssl import SSLWantWriteError
from ssl import SSLEOFError
from ssl import CERT_NONE from ssl import CERT_NONE
from ssl import SSLError from ssl import SSLError
from ssl import SSL_ERROR_EOF from ssl import SSL_ERROR_EOF
...@@ -628,9 +629,12 @@ class SSLSocket(socket): ...@@ -628,9 +629,12 @@ class SSLSocket(socket):
if self.timeout == 0.0: if self.timeout == 0.0:
raise raise
self._wait(self._write_event) self._wait(self._write_event)
except SSLEOFError:
break
except OSError as e: except OSError as e:
if e.errno == 0: if e.errno == 0:
# What does this even mean? Seen on 3.7+. # The equivalent of SSLEOFError on unpatched versions of Python.
# https://bugs.python.org/issue31122
break break
raise raise
......
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