summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2021-04-20 16:10:10 (GMT)
committerGitHub <noreply@github.com>2021-04-20 16:10:10 (GMT)
commit3309113d6131e4bbac570c4f54175ecca02d025a (patch)
treeb35f7e653b15a06654858337dfdbf7df0f590039
parent389212c5db81e6aeab660665d2c59843d8d36f8e (diff)
downloadcpython-3309113d6131e4bbac570c4f54175ecca02d025a.zip
cpython-3309113d6131e4bbac570c4f54175ecca02d025a.tar.gz
cpython-3309113d6131e4bbac570c4f54175ecca02d025a.tar.bz2
bpo-43799: Also define SSLv3_method() (GH-25481)
Signed-off-by: Christian Heimes <christian@python.org>
-rw-r--r--Lib/test/test_ssl.py8
-rw-r--r--Modules/_ssl.c3
2 files changed, 3 insertions, 8 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index ae66c3e..697971e 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -3245,10 +3245,6 @@ class ThreadedTests(unittest.TestCase):
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv3, False)
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_TLSv1, False)
# SSLv23 client with specific SSL options
- if no_sslv2_implies_sslv3_hello():
- # No SSLv2 => client will use an SSLv3 hello on recent OpenSSLs
- try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_TLS, False,
- client_options=ssl.OP_NO_SSLv2)
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_TLS, False,
client_options=ssl.OP_NO_SSLv3)
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_TLS, False,
@@ -3309,10 +3305,6 @@ class ThreadedTests(unittest.TestCase):
try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_TLS, False,
client_options=ssl.OP_NO_SSLv3)
try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_TLSv1, False)
- if no_sslv2_implies_sslv3_hello():
- # No SSLv2 => client will use an SSLv3 hello on recent OpenSSLs
- try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_TLS,
- False, client_options=ssl.OP_NO_SSLv2)
@requires_tls_version('TLSv1')
def test_protocol_tlsv1(self):
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 4b84014..e28c128 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -123,6 +123,9 @@ static void _PySSLFixErrno(void) {
#endif
/* OpenSSL API 1.1.0+ does not include version methods */
+#ifndef OPENSSL_NO_SSL3_METHOD
+extern const SSL_METHOD *SSLv3_method(void);
+#endif
#ifndef OPENSSL_NO_TLS1_METHOD
extern const SSL_METHOD *TLSv1_method(void);
#endif