diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2020-04-07 13:40:59 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-07 12:40:59 -0500 |
commit | 77debda56711fd5bd454596378943126852b1818 (patch) | |
tree | 544be3d8d9110f8bacbb63f0b5aefbd7770743fc /src | |
parent | 98c57be751fe18fec6d05152965f53ed9ade0872 (diff) | |
download | pyopenssl-77debda56711fd5bd454596378943126852b1818.tar.gz |
Drop OpenSSL 1.0.1 (#908)
Diffstat (limited to 'src')
-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): """ |