summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-06-28 11:57:08 (GMT)
committerGitHub <noreply@github.com>2022-06-28 11:57:08 (GMT)
commit600c65c094b0b48704d8ec2416930648052ba715 (patch)
tree70416a3c4b9b89b694b3e7d92c7422dfca1c2341 /Modules
parent4b854b746650214eddadb2440efd9e1544d08ccb (diff)
downloadcpython-600c65c094b0b48704d8ec2416930648052ba715.zip
cpython-600c65c094b0b48704d8ec2416930648052ba715.tar.gz
cpython-600c65c094b0b48704d8ec2416930648052ba715.tar.bz2
gh-94172: Remove ssl.PROTOCOL_SSLv2 dead code (#94312)
Remove dead code related to ssl.PROTOCOL_SSLv2. ssl.PROTOCOL_SSLv2 was already removed in Python 3.10. In test_ssl, @requires_tls_version('SSLv2') always returned False. Extract of the removed code: "OpenSSL has removed support for SSLv2".
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ssl.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index f19ee68..8ff15d1 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -138,9 +138,6 @@ extern const SSL_METHOD *TLSv1_2_method(void);
#define INVALID_SOCKET (-1)
#endif
-/* OpenSSL 1.1 does not have SSL 2.0 */
-#define OPENSSL_NO_SSL2
-
/* Default cipher suites */
#ifndef PY_SSL_DEFAULT_CIPHERS
#define PY_SSL_DEFAULT_CIPHERS 1
@@ -5825,10 +5822,6 @@ sslmodule_init_constants(PyObject *m)
#undef ADD_AD_CONSTANT
/* protocol versions */
-#ifndef OPENSSL_NO_SSL2
- PyModule_AddIntConstant(m, "PROTOCOL_SSLv2",
- PY_SSL_VERSION_SSL2);
-#endif
#ifndef OPENSSL_NO_SSL3
PyModule_AddIntConstant(m, "PROTOCOL_SSLv3",
PY_SSL_VERSION_SSL3);
@@ -5938,11 +5931,7 @@ sslmodule_init_constants(PyObject *m)
addbool(m, "HAS_NPN", 0);
addbool(m, "HAS_ALPN", 1);
-#if defined(SSL2_VERSION) && !defined(OPENSSL_NO_SSL2)
- addbool(m, "HAS_SSLv2", 1);
-#else
addbool(m, "HAS_SSLv2", 0);
-#endif
#if defined(SSL3_VERSION) && !defined(OPENSSL_NO_SSL3)
addbool(m, "HAS_SSLv3", 1);