We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd20d00 commit 1548b6eCopy full SHA for 1548b6e
1 file changed
Modules/_ssl.c
@@ -5308,13 +5308,10 @@ _ssl__SSLContext_sni_callback_set_impl(PySSLContext *self, PyObject *value)
5308
"sni_callback cannot be set on TLS_CLIENT context");
5309
return -1;
5310
}
5311
+ SSL_CTX_set_tlsext_servername_callback(self->ctx, NULL);
5312
Py_CLEAR(self->set_sni_cb);
- if (value == Py_None) {
5313
- SSL_CTX_set_tlsext_servername_callback(self->ctx, NULL);
5314
- }
5315
- else {
+ if (value != Py_None) {
5316
if (!PyCallable_Check(value)) {
5317
5318
PyErr_SetString(PyExc_TypeError,
5319
"not a callable object");
5320
0 commit comments