Skip to content

Don't create default SSLContext if ssl module isn't present - #6724

Merged
nateprewitt merged 1 commit into
mainfrom
ssl_optimization
May 29, 2024
Merged

Don't create default SSLContext if ssl module isn't present#6724
nateprewitt merged 1 commit into
mainfrom
ssl_optimization

Conversation

@nateprewitt

Copy link
Copy Markdown
Member

This PR is to address a recent regression in Emscripten support for urllib3. We began unilaterally creating an SSLContext without consideration for Python versions built without an ssl module. This is handled in urllib3 but missed in our usage of create_urllib3_context.

This PR expands on the fix in #6716 by also evaluating both the presence of the ssl module before creating and setting the default SSLContext.