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 aΒcertifi
Β 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 information? π | 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.
-
The error you're encountering is related to SSL certificate verification failure when your Python code tries to connect to the Smartsheet API. This is commonly caused by issues with outdated SSL certificates, OpenSSL, or your local environment configuration.
Hereβs what you can try to resolve the issue:
- Update Your macOS SSL Certificates: Sometimes, the local systemβs certificate bundle can be outdated. Ensure that your system certificates are up-to-date:
- Open the Keychain Access app on your Mac.
- Under the System Roots section, ensure the certificates are up-to-date.
- Upgrade Python and SSL Dependencies: If you're using an older version of Python or OpenSSL, consider upgrading them.
- Upgrade
requests
Library: Therequests
library, which is commonly used in SDKs for HTTP connections, might also need an update: - Reinstall the Python SSL Module: Sometimes Pythonβs SSL module can get misconfigured
- Disable SSL Verification: If you need a quick fix and can work without SSL verification
- Verify Your OpenSSL: The error mentions "old OpenSSL." Verify if your OpenSSL version is up to date
- Update Your macOS SSL Certificates: Sometimes, the local systemβs certificate bundle can be outdated. Ensure that your system certificates are up-to-date: