diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2016-09-24 01:52:21 -0400 |
---|---|---|
committer | Hynek Schlawack <hs@ox.cx> | 2016-09-24 07:52:21 +0200 |
commit | 5af32d0d55f5d385e5592e00a2e574a43f0b74fb (patch) | |
tree | 9a2911b0da38417eaf374cf70726bf20646c74d2 /src/OpenSSL/SSL.py | |
parent | 9f9113a7bb736a835f978d27e95603c8d6f52b7c (diff) | |
download | pyopenssl-5af32d0d55f5d385e5592e00a2e574a43f0b74fb.tar.gz |
Test on OpenSSL 1.1.0 with travis. Fixes #524 (#526)
Diffstat (limited to 'src/OpenSSL/SSL.py')
-rw-r--r-- | src/OpenSSL/SSL.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/OpenSSL/SSL.py b/src/OpenSSL/SSL.py index 2d76516..7ebf7e0 100644 --- a/src/OpenSSL/SSL.py +++ b/src/OpenSSL/SSL.py @@ -109,10 +109,11 @@ SESS_CACHE_NO_INTERNAL = _lib.SSL_SESS_CACHE_NO_INTERNAL SSL_ST_CONNECT = _lib.SSL_ST_CONNECT SSL_ST_ACCEPT = _lib.SSL_ST_ACCEPT SSL_ST_MASK = _lib.SSL_ST_MASK -SSL_ST_INIT = _lib.SSL_ST_INIT -SSL_ST_BEFORE = _lib.SSL_ST_BEFORE -SSL_ST_OK = _lib.SSL_ST_OK -SSL_ST_RENEGOTIATE = _lib.SSL_ST_RENEGOTIATE +if _lib.Cryptography_HAS_SSL_ST: + SSL_ST_INIT = _lib.SSL_ST_INIT + SSL_ST_BEFORE = _lib.SSL_ST_BEFORE + SSL_ST_OK = _lib.SSL_ST_OK + SSL_ST_RENEGOTIATE = _lib.SSL_ST_RENEGOTIATE SSL_CB_LOOP = _lib.SSL_CB_LOOP SSL_CB_EXIT = _lib.SSL_CB_EXIT @@ -1160,9 +1161,10 @@ class Connection(object): 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() |