summaryrefslogtreecommitdiff
path: root/OpenSSL/ssl/context.c
diff options
context:
space:
mode:
authorJean-Paul Calderone <exarkun@twistedmatrix.com>2012-03-09 15:04:04 -0800
committerJean-Paul Calderone <exarkun@twistedmatrix.com>2012-03-09 15:04:04 -0800
commit15f3a8683af475c0fdd0ecddbaf6d3df5c1e8bf5 (patch)
treecbc3cbe26b35cac10872ab61ac55165105954236 /OpenSSL/ssl/context.c
parentb587107276e8ff548ab8f65cf504bb4906f2fd83 (diff)
downloadpyopenssl-15f3a8683af475c0fdd0ecddbaf6d3df5c1e8bf5.tar.gz
Re-instate the OPENSSL_NO_SSL2 check; it is necessary for the case where SSLv2_method is not a defined symbol at all.
Diffstat (limited to 'OpenSSL/ssl/context.c')
-rw-r--r--OpenSSL/ssl/context.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/OpenSSL/ssl/context.c b/OpenSSL/ssl/context.c
index 534d207..e971c0a 100644
--- a/OpenSSL/ssl/context.c
+++ b/OpenSSL/ssl/context.c
@@ -1246,7 +1246,12 @@ ssl_Context_init(ssl_ContextObj *self, int i_method) {
switch (i_method) {
case ssl_SSLv2_METHOD:
+#ifdef OPENSSL_NO_SSL2
+ PyErr_SetString(PyExc_ValueError, "SSLv2_METHOD not supported by this version of OpenSSL");
+ return NULL;
+#else
method = SSLv2_method();
+#endif
break;
case ssl_SSLv23_METHOD:
method = SSLv23_method();