Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 78307c7

Browse filesBrowse files
authored
gh-94637: Release GIL in SSLContext.set_default_verify_paths (GH-94658)
1 parent 0fc8ac0 commit 78307c7
Copy full SHA for 78307c7

File tree

Expand file treeCollapse file tree

2 files changed

+8
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-1
lines changed
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:meth:`SSLContext.set_default_verify_paths` now releases the GIL around
2+
``SSL_CTX_set_default_verify_paths`` call. The function call performs I/O
3+
and CPU intensive work.

‎Modules/_ssl.c

Copy file name to clipboardExpand all lines: Modules/_ssl.c
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4302,7 +4302,11 @@ static PyObject *
43024302
_ssl__SSLContext_set_default_verify_paths_impl(PySSLContext *self)
43034303
/*[clinic end generated code: output=0bee74e6e09deaaa input=35f3408021463d74]*/
43044304
{
4305-
if (!SSL_CTX_set_default_verify_paths(self->ctx)) {
4305+
int rc;
4306+
Py_BEGIN_ALLOW_THREADS
4307+
rc = SSL_CTX_set_default_verify_paths(self->ctx);
4308+
Py_END_ALLOW_THREADS
4309+
if (!rc) {
43064310
_setSSLError(get_state_ctx(self), NULL, 0, __FILE__, __LINE__);
43074311
return NULL;
43084312
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.