Python API SDK SSL: CERTIFICATE_VERIFY_FAILED Error
I am running into this error trying to connect smartsheet api via python sdk and getting this error on a mac book pro:
smartsheet.exceptions.HttpError: (SSLError(MaxRetryError("HTTPSConnectionPool(host='api.smartsheet.com', port=443): Max retries exceeded with url: /2.0/sheets?pageSize=300&includeAll=False (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),))",),), 'SSL handshake error, old CA bundle or old OpenSSL?')
Any help would be great!
Answers
-
Hi @S_M_22
Since the error is "SSL: Certificate_Verify_Failed", this error is likely due a non up-to-date environment.
I believe Python on MacOS comes with its own private copy of OpenSSL. This means the trust certificates in the system may no longer be used as defaults by the Python
ssl
module. To fix that, you may need to install acertifi
package in your system.I found this thread on StackOverflow which may help you. If it hasn't, please reach out to your IT department as they will need to work out what's happening between Python and your Mac.
Cheers,
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
Hey,
I totally feel your frustration, as I've encountered this SSL certificate issue before. It can be quite a roadblock, but don't worry, we'll get through this together!
First off, big shoutout to the author for bringing up this problem. Connecting to APIs can sometimes be a headache, especially when SSL handshake errors jump in the way. From what I've experienced, this issue usually crops up when your Python environment isn't playing nice with the SSL certificates.
Now, onto a solution! It seems like your Mac's SSL certificates might need a refresh. I'd suggest installing the certifi package – it helps your Python environment find up-to-date certificates. Just a quick pip install away, and you might see that SSL handshake error disappear.
I've personally battled with similar SSL errors, and often it's about keeping everything updated and in sync. So, my fellow coder, give the certifi solution a shot. You'll likely find yourself back on track with your Smartsheet API endeavors.
Greetings from a cutting-edge technology developer! Explore the realm of cool and contemporary tech at https://andersenlab.de/blueprint/php-vs-python-for-web-development 😏. Feel free to get in touch with me.
-
This content has been removed.
-
The error indicates an SSL certificate verification issue when connecting to the Smartsheet API, often due to an outdated CA bundle or OpenSSL version. To resolve this on your MacBook Pro, first, update the
certifi
package by runningpip install --upgrade certifi
. Additionally, ensure your OpenSSL is up to date by using Homebrew:brew update
andbrew upgrade openssl
. Further i am mentioning one article that can be useful for you :)https://cheapsslweb.com/blog/ssl-certificate-verify-failed-error-in-python/ Hope this will work, Cheers!
-
This content has been removed.
-
This content has been removed.
-
This content has been removed.
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 434 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives