The problem you are having is caused by an untrusted SSL certificate.

Like dirk mentioned in a previous comment, the quickest fix is setting verify=False:

requests.get('https://example.com', verify=False)

Please note that this will cause the certificate not to be verified. This will expose your application to security risks, such as man-in-the-middle attacks.

Of course, apply judgment. As mentioned in the comments, this may be acceptable for quick/throwaway applications/scripts, but this should really not go to production software.

If just skipping the certificate check is not acceptable in your particular context, consider the following options, your best option is to set the verify parameter to a string that is the path of the .pem file of the certificate (which you should obtain by some sort of secure means).

So, as of version 2.0, the verify parameter accepts the following values, with their respective semantics:

  • True: causes the certificate to validated against the library's own trusted certificate authorities (Note: you can see which root certificates (RCs) Requests uses via the Certifi library, a trust database of RCs extracted from Requests: Certifi - Trust Database for Humans).

  • False: bypasses certificate validation completely.

  • Path to a CA_BUNDLE file for Requests to use to validate the certificates.

Source: Requests - SSL Cert Verification

Also take a look at the cert parameter on the same page.

Answer from Rafael Almeida on Stack Overflow
Top answer
1 of 16
723

The problem you are having is caused by an untrusted SSL certificate.

Like dirk mentioned in a previous comment, the quickest fix is setting verify=False:

requests.get('https://example.com', verify=False)

Please note that this will cause the certificate not to be verified. This will expose your application to security risks, such as man-in-the-middle attacks.

Of course, apply judgment. As mentioned in the comments, this may be acceptable for quick/throwaway applications/scripts, but this should really not go to production software.

If just skipping the certificate check is not acceptable in your particular context, consider the following options, your best option is to set the verify parameter to a string that is the path of the .pem file of the certificate (which you should obtain by some sort of secure means).

So, as of version 2.0, the verify parameter accepts the following values, with their respective semantics:

  • True: causes the certificate to validated against the library's own trusted certificate authorities (Note: you can see which root certificates (RCs) Requests uses via the Certifi library, a trust database of RCs extracted from Requests: Certifi - Trust Database for Humans).

  • False: bypasses certificate validation completely.

  • Path to a CA_BUNDLE file for Requests to use to validate the certificates.

Source: Requests - SSL Cert Verification

Also take a look at the cert parameter on the same page.

2 of 16
142

From Requests' documentation on SSL verification:

Requests can verify SSL certificates for HTTPS requests, just like a web browser. To check a host’s SSL certificate, you can use the verify argument (for example, interactively):

requests.get('https://kennethreitz.com', verify=True)

If you don't want to verify your SSL certificate, make verify=False

Discussions

SSL errors in python 3.13
Hi I am using a self signed certificate and, when using it in python 3.9, it works fine, but when using it with python 3.13, i have this error requests.exceptions.SSLError: HTTPSConnectionPool(host=‘XXX’, port=443): Ma… More on discuss.python.org
🌐 discuss.python.org
5
0
April 24, 2025
"SSL: CERTIFICATE_VERIFY_FAILED" error on Python 3.9.6 (Windows 10)
Hi! I’m new with Python and I have been following some tutorials and based on one of them I have the following piece of code: from scrapy import Selector from urllib.request import urlopen html = urlopen("https://www.… More on discuss.python.org
🌐 discuss.python.org
0
0
May 5, 2022
Update to Python 3.11 got SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)')))
You can also try to reinstall Python ... "Install launcher for all users" and "Add Python to PATH". If the error is coming from Azure Functions, it might be that the Azure Function App is not correctly configured to trust the SSL certificate.... More on learn.microsoft.com
🌐 learn.microsoft.com
1
0
Python SSL Error
Error: 0: pyembed: ConnectionError([SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)) caused by: SSLError([SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)) · Its a self signed certificate hence the verify_certs is set to none. More on discuss.elastic.co
🌐 discuss.elastic.co
12
0
July 8, 2019
People also ask

Does updating Python fix SSL certificate errors?
Updating Python often resolves certificate errors because newer versions include updated CA bundles and improved SSL handling. Python 3.10+ comes with better certificate management and automatic certifi integration. However, you may still need to run the post-installation certificate script on macOS or manually update certifi on older systems.
🌐
sslinsights.com
sslinsights.com › home › wiki › how to fix ssl certificate_verify_failed error in python
Fix Python SSL CERTIFICATE_VERIFY_FAILED Error in 2026
Why does Python reject valid SSL certificates?
Python relies on a certificate authority (CA) bundle to verify website identities. When this bundle becomes outdated or missing, Python flags even legitimate certificates as suspicious. Corporate networks create another common trigger where company firewalls intercept HTTPS traffic using self-signed certificates that Python doesn't recognize.
🌐
sslinsights.com
sslinsights.com › home › wiki › how to fix ssl certificate_verify_failed error in python
Fix Python SSL CERTIFICATE_VERIFY_FAILED Error in 2026
What's the difference between SSL and TLS in Python errors?
SSL (Secure Sockets Layer) and TLS (Transport Layer Security) refer to the same encryption protocols in Python, with TLS being the modern version. Python's error messages use SSL for historical reasons, but the actual protocol is TLS 1.2 or 1.3. Both terms appear interchangeably in error messages and documentation.
🌐
sslinsights.com
sslinsights.com › home › wiki › how to fix ssl certificate_verify_failed error in python
Fix Python SSL CERTIFICATE_VERIFY_FAILED Error in 2026
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-fix-python-requests-sslerror
How to Fix Python Requests SSLError? - GeeksforGeeks
July 23, 2025 - SSLError in Python's requests library typically occurs due to issues related to SSL certificates. Here are some common reasons why this error might be triggered:
🌐
Python
docs.python.org › 3 › library › ssl.html
ssl — TLS/SSL wrapper for socket objects — Python 3.14.4 ...
The range of possible values depends on the OpenSSL version. Added in version 3.3. ... A subclass of SSLError raised when trying to read or write and the SSL connection has been closed cleanly.
🌐
Python.org
discuss.python.org › python help
SSL errors in python 3.13 - Python Help - Discussions on Python.org
April 24, 2025 - Hi I am using a self signed certificate and, when using it in python 3.9, it works fine, but when using it with python 3.13, i have this error requests.exceptions.SSLError: HTTPSConnectionPool(host=‘XXX’, port=443): Ma…
🌐
ScrapeOps
scrapeops.io › home › python web scraping playbook › python requests fix ssl error
Fix SSL Errors in Python Requests | ScrapeOps
May 5, 2024 - Fix Python Requests SSL errors - learn certificate validation, hostname verification, handshake failures, and best practices for SSL handling.
Find elsewhere
🌐
ScrapingBee
scrapingbee.com › webscraping-questions › requests › how-to-fix-ssl-error-in-python-requests
How to fix SSLError in Python requests? | ScrapingBee
SSLError occurs when you request a remote URL that does not provide a trusted SSL certificate. The easiest way to fix this issue is to disable SSL verification for that particular web address by passing in verify=False as an argument to the ...
🌐
Esri Community
community.esri.com › t5 › python-questions › solving-ssl-errors-in-python-requests › td-p › 1124005
Solving SSL Errors in Python Requests - Esri Community
February 12, 2025 - I concluded that Python must not be referencing the certificates in my operating systems certificate store and must use it's own. So I did an uninstall and a fresh install of ArcGIS Pro.
🌐
SSLInsights
sslinsights.com › home › wiki › how to fix ssl certificate_verify_failed error in python
Fix Python SSL CERTIFICATE_VERIFY_FAILED Error in 2026
2 weeks ago - Both terms appear interchangeably in error messages and documentation. Install CA certificates in your Dockerfile using RUN apt-get update && apt-get install -y ca-certificates for Debian/Ubuntu images. Then install Python’s certifi package and set the REQUESTS_CA_BUNDLE environment variable to point to /etc/ssl/certs/ca-certificates.crt.
🌐
Python.org
discuss.python.org › python help
"SSL: CERTIFICATE_VERIFY_FAILED" error on Python 3.9.6 (Windows 10) - Python Help - Discussions on Python.org
May 5, 2022 - Hi! I’m new with Python and I have been following some tutorials and based on one of them I have the following piece of code: from scrapy import Selector from urllib.request import urlopen html = urlopen("https://www.pythonparatodos.com.br/formulario.html") sel = Selector(text = html.read()) lista = sel.xpath('//input[@type="text"]') print(lista) for selector in lista: print(selector) The URL is easily accessed through a browser but when I run the code I got the following errors: C:\Use...
🌐
Microsoft Learn
learn.microsoft.com › en-gb › answers › questions › 2077926 › update-to-python-3-11-got-sslerror(sslcertverifica
Update to Python 3.11 got SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)'))) - Microsoft Q&A
You can also try to reinstall Python 3.11 and make sure that during the installation, you check the box that says "Install launcher for all users" and "Add Python to PATH". If the error is coming from Azure Functions, it might be that the Azure Function App is not correctly configured to trust the SSL certificate.
🌐
Cheap SSL Web
cheapsslweb.com › home › how to fix “ssl: certificate_verify_failed” error in python?
Fix SSL: CERTIFICATE_VERIFY_FAILED Error in Python
December 8, 2025 - If the SSL certificate chain is broken or incomplete, the client cannot verify the SSL certificate, resulting in the certificate_verify_failed error. (Assuming the chain has a leaf and intermediate certificates, but the Root certificate is missing) ...
🌐
DEV Community
dev.to › toby-patrick › how-to-fix-ssl-certificateverifyfailed-in-python-requests-35nl
How to Fix “SSL: CERTIFICATE_VERIFY_FAILED” in Python Requests - DEV Community
September 15, 2025 - If the server uses a self-signed certificate, Python won’t recognize it as trustworthy unless you manually configure your system to trust it. Some enterprise environments perform SSL inspection using internal certificates. These often trigger verification errors because Python doesn’t recognize the internal CA.
🌐
Elastic
discuss.elastic.co › elastic stack › elasticsearch
Python SSL Error - Elasticsearch - Discuss the Elastic Stack
July 8, 2019 - Error: 0: pyembed: ConnectionError([SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)) caused by: SSLError([SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)) · Its a self signed certificate hence the verify_certs is set to none.
🌐
Medium
bayinmin.medium.com › tutorial-6-fix-ssl-error-in-python-requests-when-proxying-through-burp-suite-0bd67d417663
Tutorial #6: Fix SSL Error in Python requests when proxying through Burp Suite | by Ba Yin Min | Medium
November 20, 2024 - tl;dr — Two ways to fix: either disable SSL checking completely with verify=False (the dirty approach) or use verify=<path to cert> to enforce certificate check against a chosen certificate from a desired local location.
🌐
Chainstack Support
support.chainstack.com › hc › en-us › articles › 9117198436249-Common-SSL-Issues-on-Python-and-How-to-Fix-it
Common SSL Issues on Python and How to Fix it – Chainstack Support
Common SSL Issues on Python and How to Fix it · Error reference · REST API · API tutorial · Chainstack Support · March 04, 2024 07:56 · Updated · SSL errors occur when the client cannot trust the server’s certificate, either because it is outdated, invalid, or not chained to a trusted root.
🌐
Scrapfly
scrapfly.io › blog › answers › python-requests-exception-sllerror
How to fix Python requests SSLError? - Scrapfly Blog
3 weeks ago - The SSLError exception is rarely encountered in web scraping but the easiest way to fix it is to simply disable certification verification (verify=False parameter) if no sensitive data is being exchanged.
🌐
ProxiesAPI
proxiesapi.com › articles › how-to-fix-sslerror-in-python-requests
How to fix SSLError in Python requests | ProxiesAPI
Properly handle SSL errors in Python requests by updating CA bundles, fixing certificates, and using TLS 1.2+. Use SSLContext for full control over SSL behavior.
🌐
ClickSSL
clickssl.net › blog › ssl-certificate-verify-failed-error-in-python
How to Fix SSL: CERTIFICATE_VERIFY_FAILED Error In Python?
Another error that is common in Python is pip SSL certificate_verify_failed. Especially when you are installing Python packages into an organization’s network, it will block the certificate.
🌐
Vocal Media
vocal.media › education › 15-common-ssl-configuration-errors-in-python-and-how-to-fix-them
15 Common SSL Configuration Errors in Python and How to Fix Them | Education
By understanding why these errors happen and how to fix them, you can keep your Python applications secure and running smoothly. ... Check your SSL certificates.