AppEngine urlfetch validate_certificate=False/None not being respected

I ran into the same issue on Windows. I was using an old version of Python (2.7). When I upgraded to Python 2.7.11, the problem went away.


This is a dev_appserver bug caused by a httplib.HTTPSConnection behavior change (certificate check turned on by default) in some recent Python release (I belive 2.7.9).

As the bug is in internal dev_appserver code (file google_appengine/google/appengine/api/urlfetch_stub.py of the appengine SDK) that is run independently of the tested application, there is no way to make a fix that will survive a SDK update.

The only permanent workaround I can think of will be to enable validate_certificate and add CA certificate to the urlfetch_cacerts.txt file. As a temporary fix, you can patch urlfetch_stub.py with workaround #3.