SSL Issue Error 185090050 When Authentication Through Oauth

I try to use Google Oauth to connect to Google adsense and get this error. Any clues to fix this?

Has anyone encountered such a problem before in python?

Traceback (most recent call last): File "get_all_saved_reports.py", line 56, in <module> main(sys.argv) File "get_all_saved_reports.py", line 36, in main service = sample_utils.initialize_service() File "/home/nish/Programs/python/google-adsense/samples/adsense/sample_utils.py", line 114, in initialize_service credentials = prepare_credentials() File "/home/nish/Programs/python/google-adsense/samples/adsense/sample_utils.py", line 95, in prepare_credentials credentials = run(FLOW, storage) File "/usr/local/lib/python2.7/dist-packages/oauth2client-1.1-py2.7.egg/oauth2client/util.py", line 128, in positional_wrapper return wrapped(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/oauth2client-1.1-py2.7.egg/oauth2client/tools.py", line 197, in run credential = flow.step2_exchange(code, http=http) File "/usr/local/lib/python2.7/dist-packages/oauth2client-1.1-py2.7.egg/oauth2client/util.py", line 128, in positional_wrapper return wrapped(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/oauth2client-1.1-py2.7.egg/oauth2client/client.py", line 1283, in step2_exchange headers=headers) File "/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 1571, in request (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey) File "/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 1318, in _request (response, content) = self._conn_request(conn, request_uri, method, body, headers) File "/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 1253, in _conn_request conn.connect() File "/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 1022, in connect self.disable_ssl_certificate_validation, self.ca_certs) File "/usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 80, in _ssl_wrap_socket cert_reqs=cert_reqs, ca_certs=ca_certs) File "/usr/lib/python2.7/ssl.py", line 381, in wrap_socket ciphers=ciphers) File "/usr/lib/python2.7/ssl.py", line 141, in __init__ ciphers) ssl.SSLError: [Errno 185090050] _ssl.c:340: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib 
+8
python authentication ssl adsense
source share
4 answers

I was getting this exact x509 error in oauth2 (for the Twitter API, not Google API) with Python 2.7.5 and used the Akshay Valsa tip and changed the permissions to cacerts.txt with

 chmod 644 /usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/cacerts.txt 

This fixed the problem, and now I can run my module as a regular user, instead of judging it. Thanks!

+30
source share

This problem occurs when downloading certificate files. If you run the program with a root user, this problem will be resolved. Or you can check the permissions of the file: /usr/local/lib/python2.7/dist-packages/httplib2-0.8-py2.7.egg/httplib2/cacerts.txt and provide the necessary permission to this file.

+7
source share

In my case, I started the Django development server. If the server was started before moving to the virtual environment, I found [Errno 185090050] _ssl.c: 345: error: 0B084002: x509 verification procedure: X509_load_cert_crl_file: system lib in my trace. Simply put, I no longer ran the httplib2 version that created the certificates: most likely, I ran the dist package. (Ububtu 13.10), Python 2.7, Django 1.62. Hope this helps others.

+1
source share

I understood the solution. Google OAuth is crazy to understand, and I had to run the script as sudo / root for the first time. It worked. Also make sure that privileges are set correctly.

0
source share

All Articles