summaryrefslogtreecommitdiffstats
path: root/Modules/_ssl.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-12-06 02:59:35 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-12-06 02:59:35 (GMT)
commit60766c47e7008149e3f4091bebe9ee25a0b98bd2 (patch)
treec26174e2e5e203bc1abff7f73f9f56280349a4a0 /Modules/_ssl.c
parent238afb796c2f4368b9968d630f5ffa1e9460ed18 (diff)
downloadcpython-60766c47e7008149e3f4091bebe9ee25a0b98bd2.zip
cpython-60766c47e7008149e3f4091bebe9ee25a0b98bd2.tar.gz
cpython-60766c47e7008149e3f4091bebe9ee25a0b98bd2.tar.bz2
allow ssl module to compile if openssl doesn't support SSL 3 (closes #22935)
Patch by Kurt Roeckx.
Diffstat (limited to 'Modules/_ssl.c')
-rw-r--r--Modules/_ssl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 8ee8c3d..898d6c0 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -1997,8 +1997,10 @@ context_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
else if (proto_version == PY_SSL_VERSION_TLS1_2)
ctx = SSL_CTX_new(TLSv1_2_method());
#endif
+#ifndef OPENSSL_NO_SSL3
else if (proto_version == PY_SSL_VERSION_SSL3)
ctx = SSL_CTX_new(SSLv3_method());
+#endif
#ifndef OPENSSL_NO_SSL2
else if (proto_version == PY_SSL_VERSION_SSL2)
ctx = SSL_CTX_new(SSLv2_method());
@@ -4023,8 +4025,10 @@ init_ssl(void)
PyModule_AddIntConstant(m, "PROTOCOL_SSLv2",
PY_SSL_VERSION_SSL2);
#endif
+#ifndef OPENSSL_NO_SSL3
PyModule_AddIntConstant(m, "PROTOCOL_SSLv3",
PY_SSL_VERSION_SSL3);
+#endif
PyModule_AddIntConstant(m, "PROTOCOL_SSLv23",
PY_SSL_VERSION_SSL23);
PyModule_AddIntConstant(m, "PROTOCOL_TLSv1",