]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Further compiling fixes (issue #17581)
authorAntoine Pitrou <solipsis@pitrou.net>
Sat, 30 Mar 2013 15:36:54 +0000 (16:36 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Sat, 30 Mar 2013 15:36:54 +0000 (16:36 +0100)
Modules/_ssl.c

index bcabd673b389d425b3b51574947898adeaf10273..57a598e4e235a5569bfe49d0b29b7ef4040ab2d2 100644 (file)
@@ -1207,7 +1207,7 @@ static int PySSL_set_context(PySSLSocket *self, PyObject *value,
 #if !HAVE_SNI
         PyErr_SetString(PyExc_NotImplementedError, "setting a socket's "
                         "context is not supported by your OpenSSL library");
-        return NULL;
+        return -1;
 #else
         Py_INCREF(value);
         Py_DECREF(self->ctx);
@@ -2542,6 +2542,7 @@ set_servername_callback(PySSLContext *self, PyObject *args)
                     "The TLS extension servername callback, "
                     "SSL_CTX_set_tlsext_servername_callback, "
                     "is not in the current OpenSSL library.");
+    return NULL;
 #endif
 }
 
@@ -2574,8 +2575,10 @@ static struct PyMethodDef context_methods[] = {
     {"set_ecdh_curve", (PyCFunction) set_ecdh_curve,
                        METH_O, NULL},
 #endif
+#if HAVE_SNI && !defined(OPENSSL_NO_TLSEXT)
     {"set_servername_callback", (PyCFunction) set_servername_callback,
                     METH_VARARGS, PySSL_set_servername_callback_doc},
+#endif
     {NULL, NULL}        /* sentinel */
 };