toolbelt
toolbelt copied to clipboard
Google App Engine monkeypatch(validate_certificate=False) keeps attempting to validate certificates
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
It seems you have a clear understanding of the problem. I'd happily merge a PR that solves the issue here.