question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)` When opening sheet

See original GitHub issue

After successfully authenticating I’m getting an SSL error whenever I try to open a sheet.

scope = ['https://spreadsheets.google.com/feeds']
credentials = SignedJwtAssertionCredentials(GOOGLE_AUTH['client_email'], GOOGLE_AUTH['private_key'], scope)
gc = gspread.authorize(credentials)

sh = gc.open('Genesis-QuestionBank')
Traceback (most recent call last):
  File "genesis/bin/import_questions.py", line 27, in <module>
    sh = gc.open('Genesis-QuestionBank')
  File "/Users/administrator2/.virtualenvs/genesis/lib/python2.7/site-packages/gspread/client.py", line 134, in open
    feed = self.get_spreadsheets_feed()
  File "/Users/administrator2/.virtualenvs/genesis/lib/python2.7/site-packages/gspread/client.py", line 220, in get_spreadsheets_feed
    r = self.session.get(url)
  File "/Users/administrator2/.virtualenvs/genesis/lib/python2.7/site-packages/gspread/httpsession.py", line 79, in get
    return self.request('GET', url, **kwargs)
  File "/Users/administrator2/.virtualenvs/genesis/lib/python2.7/site-packages/gspread/httpsession.py", line 71, in request
    uri.scheme + uri.netloc].request(method, url, data, headers=request_headers)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1001, in request
    self._send_request(method, url, body, headers)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1035, in _send_request
    self.endheaders(body)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 997, in endheaders
    self._send_output(message_body)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 850, in _send_output
    self.send(msg)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 812, in send
    self.connect()
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1212, in connect
    server_hostname=server_hostname)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 350, in wrap_socket
    _context=self)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 566, in __init__
    self.do_handshake()
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 788, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:18 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
Ralithunecommented, Jun 5, 2017

So, I don’t know what happened, but for some reasons python package Requests 2.16.0 started requiring Certifi, which causes this SSL error. I had to specify version 2.15.1 to be able to uninstall certifi and restore service to my automation. pip install requests==2.15.1; pip uninstall -y certifi

5reactions
Ralithunecommented, Jun 23, 2016

I thought I posted a comment about what this was for me - it turned out the Python package “certifi” which is part of a other Python package “Tornado” was causing this error. I used:

pip uninstall -y certifi

And the error went away, and Tornado appeared to still work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed ...
The shell script got executed. Opened the Python 3.6.5 and typed in nltk.download() .The download graphic window opened and all the packages got...
Read more >
Python API SDK SSL: CERTIFICATE_VERIFY_FAILED Error
Answers. Since the error is "SSL: Certificate_Verify_Failed", this error is likely due a non up-to-date environment. I believe Python on MacOS ...
Read more >
[Solved] urllib.error.URLError: [SSL - Clay-Technology World
Simply put, the error seems an error in verifying the SSL certificate. Maybe the target website uses a certificate signed by itself, I'm...
Read more >
4 Ways to fix SSL: CERTIFICATE_VERIFY_FAILED in Python
If you receive the “certificate_verify_failed” error when trying to connect to a website, it means that the certificate on the website is not...
Read more >
SSL Certificate Invalid - Python API - DataRobot Community
Solved: Hi, The error as it says is because it cannot validate certificates. Setting ssl_verify =False, works but it throws.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found