8000 Ensure eventlet SSL HTTPs contexts allow HTTP verify disabled by Tehsmash · Pull Request #485 · eventlet/eventlet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Ensure eventlet SSL HTTPs contexts allow HTTP verify disabled #485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion eventlet/green/ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ def verify_mode(self, value):

if hasattr(__ssl, 'create_default_context'):
_original_create_default_context = __ssl.create_default_context
_original_create_default_https_context = __ssl._create_default_https_context

def green_create_default_context(*a, **kw):
# We can't just monkey-patch on the green version of `wrap_socket`
Expand All @@ -435,5 +436,14 @@ def green_create_default_context(*a, **kw):
context.__class__ = GreenSSLContext
return context

def green_create_default_https_context(*a, **kw):
# We can't just monkey-patch on the green version of `wrap_socket`
# on to SSLContext instances, but SSLContext.create_default_context
# does a bunch of work. Rather than re-implementing it all, just
# switch out the __class__ to get our `wrap_socket` implementation
context = _original_create_default_https_context(*a, **kw)
context.__class__ = GreenSSLContext
return context

create_default_context = green_create_default_context
_create_default_https_context = green_create_default_context
_create_default_https_context = green_create_default_https_context
0