Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 41f8c4f

Browse files
committed
Further compiling fixes (issue #17581)
1 parent 9498839 commit 41f8c4f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Modules/_ssl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ static int PySSL_set_context(PySSLSocket *self, PyObject *value,
12071207
#if !HAVE_SNI
12081208
PyErr_SetString(PyExc_NotImplementedError, "setting a socket's "
12091209
"context is not supported by your OpenSSL library");
1210-
return NULL;
1210+
return -1;
12111211
#else
12121212
Py_INCREF(value);
12131213
Py_DECREF(self->ctx);
@@ -2542,6 +2542,7 @@ set_servername_callback(PySSLContext *self, PyObject *args)
25422542
"The TLS extension servername callback, "
25432543
"SSL_CTX_set_tlsext_servername_callback, "
25442544
"is not in the current OpenSSL library.");
2545+
return NULL;
25452546
#endif
25462547
}
25472548

@@ -2574,8 +2575,10 @@ static struct PyMethodDef context_methods[] = {
25742575
{"set_ecdh_curve", (PyCFunction) set_ecdh_curve,
25752576
METH_O, NULL},
25762577
#endif
2578+
#if HAVE_SNI && !defined(OPENSSL_NO_TLSEXT)
25772579
{"set_servername_callback", (PyCFunction) set_servername_callback,
25782580
METH_VARARGS, PySSL_set_servername_callback_doc},
2581+
#endif
25792582
{NULL, NULL} /* sentinel */
25802583
};
25812584

0 commit comments

Comments
 (0)