Skip to content
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

Google App Engine monkeypatch(validate_certificate=False) keeps attempting to validate certificates #207

Open
kjschiroo opened this issue Jan 22, 2018 · 1 comment

Comments

@kjschiroo
Copy link

Using monkeypatch with validate_certificate=False as shown below does not have the desired effect and certificates continue to be checked.

requests_toolbelt.adapters.appengine.monkeypatch(validate_certificate=False)

This comes from monkeypatch setting adapters.HTTPAdapter = InsecureAppEngineAdapter. When InsecureAppEngineAdapter is initialized it calls its way up to the requests library's HTTPAdapter using super. Within HTTPAdapter::__init__ there is a call to super(HTTPAdapter, self).__init__(). At this point HTTPAdapter == InsecureAppEngineAdapter so it starts the __init__ process again, but now it starts at AppEngineAdapter since we aren't telling it not to validate_certificate it defaults to True

@sigmavirus24
Copy link
Collaborator

It seems you have a clear understanding of the problem. I'd happily merge a PR that solves the issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants