diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2017-06-29 20:56:12 -0700 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2017-06-29 22:56:12 -0500 |
commit | aa32e71de55f5f00666bacac5d8d691f17e60d34 (patch) | |
tree | 5f61238fdb2a3562edd86adacee29b04ffadab9f /tests/test_ssl.py | |
parent | 55fb34146c496e7c997d7418e16dd67a191fca7f (diff) | |
download | pyopenssl-git-aa32e71de55f5f00666bacac5d8d691f17e60d34.tar.gz |
Fixed #461 -- make the tests pass when SSLv3 isn't supported (#644)
* Fixed #461 -- make the tests pass when SSLv3 isn't supported
We no longer support OpenSSL 1.0.0, so TLSv1.2 should always be available and this code can be simplified.
* Try the opposite direction?
* Another shot at getting this passing
* uhhh
* grump
Diffstat (limited to 'tests/test_ssl.py')
-rw-r--r-- | tests/test_ssl.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test_ssl.py b/tests/test_ssl.py index fafffa3..1ca7f8b 100644 --- a/tests/test_ssl.py +++ b/tests/test_ssl.py @@ -2509,12 +2509,14 @@ class TestConnection(object): # Make this work on both OpenSSL 1.0.0, which doesn't support TLSv1.2 # and also on OpenSSL 1.1.0 which doesn't support SSLv3. (SSL_ST_INIT # is a way to check for 1.1.0) - if SSL_ST_INIT is not None: + if SSL_ST_INIT is None: + v1 = TLSv1_2_METHOD + v2 = TLSv1_METHOD + elif hasattr(_lib, "SSLv3_method"): v1 = TLSv1_METHOD v2 = SSLv3_METHOD else: - v1 = TLSv1_2_METHOD - v2 = TLSv1_METHOD + pytest.skip("Test requires either OpenSSL 1.1.0 or SSLv3") key = load_privatekey(FILETYPE_PEM, server_key_pem) cert = load_certificate(FILETYPE_PEM, server_cert_pem) |