Python Httplib2 Certificate Verify Failed
Solution 1:
OK... Big thanks to Steffen Ullrich.
httplib2 version 0.9 tries to use the system certificates and not the certs.txt file that used to be shipped with it. It also enforces verification.
httplib2 can take a couple of useful parameters - notably ca_certs. Use it to point to the actual *.pem file in you ssl installation. I cannot be a folder, must be a real file.
I use the following in the initialization of the plugin :
self.http = httplib2.Http(ca_certs = '/etc/ssl/ca-bundle.pem')
Then, for all subsequent calls to httplib or google client libraries, I pass my pre-built http object as a parameter like this:
- Httpexception: Invalid And/or Missing Ssl Certificate For Url: Https://accounts.google.com/o/oauth2/token
- Https Proxies With Requests: [errno 8] _ssl.c:504: Eof Occurred In Violation Of Protocol
- Creating New Process For Each Request On Ssl Socket Gives "typeerror: Cannot Serialize Socket Object", But Doing Same With Normal/non Ssl Socket Works
credentials = self.flow.step2_exchange(code, self.http)
self.http = credentials.authorize(self.http)
Now ssl connections work with the new httplib2...
I will eventually have to make sure the plugin can find certificates on any system, but at least I know what the problem was.
Thanks again to Steffen Ullrich for walking me through this.
Post a Comment for "Python Httplib2 Certificate Verify Failed"