Skip to content

Commit

Permalink
OpenSSL 1.1.0 gives us a syscall error on EOF
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Sep 10, 2016
1 parent e9d0212 commit d6e2474
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/OpenSSL/SSL.py
Original file line number Diff line number Diff line change
Expand Up @@ -1161,9 +1161,10 @@ def _raise_ssl_error(self, ssl, result):
errno = _ffi.getwinerror()[0]
else:
errno = _ffi.errno
raise SysCallError(errno, errorcode.get(errno))
else:
raise SysCallError(-1, "Unexpected EOF")

if errno != 0:
raise SysCallError(errno, errorcode.get(errno))
raise SysCallError(-1, "Unexpected EOF")
else:
# TODO: This is untested.
_raise_current_error()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3557,7 +3557,7 @@ def test_shutdown(self):
e = self.assertRaises(Error, server.recv, 1024)
# We don't want WantReadError or ZeroReturnError or anything - it's a
# handshake failure.
self.assertEquals(e.__class__, Error)
assert type(e) in [Error, SysCallError]

def test_unexpectedEndOfFile(self):
"""
Expand Down

0 comments on commit d6e2474

Please sign in to comment.