diff options
author | Alex Gaynor <alex@alloy.us> | 2020-04-06 12:17:21 -0400 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2020-04-06 19:10:41 -0400 |
commit | e3a8c9fcd7ee646eb3e755af1a4a6e07f58cd883 (patch) | |
tree | 544be3d8d9110f8bacbb63f0b5aefbd7770743fc /src/OpenSSL/SSL.py | |
parent | 98c57be751fe18fec6d05152965f53ed9ade0872 (diff) | |
download | pyopenssl-drop-1.0.1.tar.gz |
Drop OpenSSL 1.0.1drop-1.0.1
Diffstat (limited to 'src/OpenSSL/SSL.py')
-rw-r--r-- | src/OpenSSL/SSL.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/OpenSSL/SSL.py b/src/OpenSSL/SSL.py index 03f1455..25308f1 100644 --- a/src/OpenSSL/SSL.py +++ b/src/OpenSSL/SSL.py @@ -727,14 +727,11 @@ class Context(object): _openssl_assert(context != _ffi.NULL) context = _ffi.gc(context, _lib.SSL_CTX_free) - # If SSL_CTX_set_ecdh_auto is available then set it so the ECDH curve - # will be auto-selected. This function was added in 1.0.2 and made a - # noop in 1.1.0+ (where it is set automatically). - try: - res = _lib.SSL_CTX_set_ecdh_auto(context, 1) - _openssl_assert(res == 1) - except AttributeError: - pass + # Set SSL_CTX_set_ecdh_auto so that the ECDH curve will be + # auto-selected. This function was added in 1.0.2 and made a noop in + # 1.1.0+ (where it is set automatically). + res = _lib.SSL_CTX_set_ecdh_auto(context, 1) + _openssl_assert(res == 1) self._context = context self._passphrase_helper = None @@ -2309,8 +2306,7 @@ class Connection(object): raise TypeError("session must be a Session instance") result = _lib.SSL_set_session(self._ssl, session._session) - if not result: - _raise_current_error() + _openssl_assert(result == 1) def _get_finished_message(self, function): """ |