Framester February 2016

"SSLError certificate verify failed" for every domain/url

I broke the SSL setup of my machine. Every request call now ends in an certificate verify failed.

I am not sure what caused this, but I moved some module, that I had installed va pip install -e . and reinstalled it. After that I noticed that error.

I tried sudo apt-get install libffi-dev and pip install requests[security] --user --upgrade but it did not help.

Here the whole output:

import requests; requests.get('https://www.google.com')

---------------------------------------------------------------------------
SSLError                                  Traceback (most recent call last)
<ipython-input-1-b4a9dae5ffaa> in <module>()
      1 import requests
----> 2 requests.get('https://www.google.com')

/home/my_computer/.local/lib/python2.7/site-packages/requests/api.pyc in get(url, params, **kwargs)
     65 
     66     kwargs.setdefault('allow_redirects', True)
---> 67     return request('get', url, params=params, **kwargs)
     68 
     69 

/home/my_computer/.local/lib/python2.7/site-packages/requests/api.pyc in request(method, url, **kwargs)
     51     # cases, and look like a memory leak in others.
     52     with sessions.Session() as session:
---> 53         return session.request(method=method, url=url, **kwargs)
     54 
     55 

/home/my_computer/.local/lib/python2.7/site-packages/requests/sessions.pyc in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    466         }
    467         send_kwargs.update(settings)
--> 468         resp = self.send(prep, **send_kwargs)
    469 
    470         return resp

/home/my_computer/.local/lib/python2.7/site-packages/requests/sessions.pyc in send(self, request, **kwargs)
    574 
    575         # Send the request
--> 576         r = adapter.send(request, **kwargs)
    577 
    578                

Answers


Framester February 2016

It is the same issue as here: SSL3_GET_SERVER_CERTIFICATE certificate verify failed on Python when requesting (only) *.google.com

To fix one needs to run:

pip uninstall -y certifi && pip install certifi==2015.04.28

Post Status

Asked in February 2016
Viewed 3,014 times
Voted 12
Answered 1 times

Search




Leave an answer