summaryrefslogtreecommitdiffstats
path: root/Modules/_ssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_ssl.c')
-rw-r--r--Modules/_ssl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index bcabd67..57a598e 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -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 */
};