mamaduckmaster / httplib2

Automatically exported from code.google.com/p/httplib2
0 stars 0 forks source link

OpenSSL Exception when Utilizing OAuth2Client + PyInstaller on Mac #240

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'm having a bit of trouble duplicating this, but I wanted to file it.  
httplib2 seemed like the "better" place for this to be since that's what's 
tossing the exception up.

I'm writing an app that is using oauth2client's JWT credentials.  I'm packing 
the app using pyinstaller (latest svn build) on Mac 10.7 using Python2.7 from 
MacPorts.  This works flawlessly in "native" python.  It might be something to 
do with the "fake" python environment utilized by Pyinstaller.

In my pyinstaller bundled app when attempting to refresh an oauth2 access 
token, I get the following exception:

12/13/12 1:35:08.009 AM [0x0-0x108007f].main: [Errno 185090050] _ssl.c:340: 
error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib
12/13/12 1:35:08.009 AM [0x0-0x108007f].main: Traceback (most recent call last):
12/13/12 1:35:08.009 AM [0x0-0x108007f].main:   File 
"main/build/pyi.darwin/main/out00-PYZ.pyz/oauth2gmail", line 25, in 
refresh_credentials
12/13/12 1:35:08.009 AM [0x0-0x108007f].main:   File 
"main/build/pyi.darwin/main/out00-PYZ.pyz/oauth2client.client", line 447, in 
refresh
12/13/12 1:35:08.009 AM [0x0-0x108007f].main:   File 
"main/build/pyi.darwin/main/out00-PYZ.pyz/oauth2client.client", line 573, in 
_refresh
12/13/12 1:35:08.009 AM [0x0-0x108007f].main:   File 
"main/build/pyi.darwin/main/out00-PYZ.pyz/oauth2client.client", line 602, in 
_do_refresh_request
12/13/12 1:35:08.009 AM [0x0-0x108007f].main:   File 
"main/build/pyi.darwin/main/out00-PYZ.pyz/oauth2client.util", line 120, in 
positional_wrapper
12/13/12 1:35:08.009 AM [0x0-0x108007f].main:   File 
"main/build/pyi.darwin/main/out00-PYZ.pyz/oauth2client.client", line 405, in 
new_request
12/13/12 1:35:08.009 AM [0x0-0x108007f].main:   File 
"main/build/pyi.darwin/main/out00-PYZ.pyz/oauth2client.client", line 573, in 
_refresh
12/13/12 1:35:08.009 AM [0x0-0x108007f].main:   File 
"main/build/pyi.darwin/main/out00-PYZ.pyz/oauth2client.client", line 602, in 
_do_refresh_request
12/13/12 1:35:08.009 AM [0x0-0x108007f].main:   File 
"main/build/pyi.darwin/main/out00-PYZ.pyz/httplib2", line 1597, in request
12/13/12 1:35:08.009 AM [0x0-0x108007f].main:   File 
"main/build/pyi.darwin/main/out00-PYZ.pyz/httplib2", line 1345, in _request
12/13/12 1:35:08.009 AM [0x0-0x108007f].main:   File 
"main/build/pyi.darwin/main/out00-PYZ.pyz/httplib2", line 1281, in _conn_request
12/13/12 1:35:08.009 AM [0x0-0x108007f].main:   File 
"main/build/pyi.darwin/main/out00-PYZ.pyz/httplib2", line 1013, in connect
12/13/12 1:35:08.009 AM [0x0-0x108007f].main:   File 
"main/build/pyi.darwin/main/out00-PYZ.pyz/httplib2", line 80, in 
_ssl_wrap_socket
12/13/12 1:35:08.009 AM [0x0-0x108007f].main:   File 
"main/build/pyi.darwin/main/out00-PYZ.pyz/ssl", line 381, in wrap_socket
12/13/12 1:35:08.009 AM [0x0-0x108007f].main:   File 
"main/build/pyi.darwin/main/out00-PYZ.pyz/ssl", line 141, in __init__
12/13/12 1:35:08.009 AM [0x0-0x108007f].main: SSLError: [Errno 185090050] 
_ssl.c:340: error:0B084002:x509 certificate 
routines:X509_load_cert_crl_file:system lib

I thought this might have been an issue with just SSL, but I made a simple app 
that makes an https request to Google and it works just fine.

I was able to get my app to work okay by setting the following value:
http = httplib2.Http()
http.disable_ssl_certificate_validation = True

I read a bit online, and it sounds like it might not have access to the 
system's CRL list -- which would sort of make sense.  However, I'm grabbing at 
straws on this one.

If this is more of an OpenSSL bug -- I'm sorry, go ahead and close this one :)

Original issue reported on code.google.com by richie.f...@gmail.com on 13 Dec 2012 at 9:11

GoogleCodeExporter commented 8 years ago
I'm also encountering this error on Windows Vista.

Original comment by josephra...@gmail.com on 3 Jul 2013 at 10:27