Skip to content

Commit 13d2e7d

Browse files
committed
Lock the context when creating a new SSL socket.
1 parent 4f6928d commit 13d2e7d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/_ssl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -896,9 +896,9 @@ newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
896896
/* Make sure the SSL error state is initialized */
897897
ERR_clear_error();
898898

899-
Py_BEGIN_ALLOW_THREADS
899+
PySSL_BEGIN_ALLOW_THREADS(sslctx)
900900
self->ssl = SSL_new(ctx);
901-
Py_END_ALLOW_THREADS
901+
PySSL_END_ALLOW_THREADS(sslctx)
902902
_PySSL_FIX_ERRNO;
903903
if (self->ssl == NULL) {
904904
Py_DECREF(self);

0 commit comments

Comments
 (0)