     [Answers](https://scrapfly.io/blog)   /  [python](https://scrapfly.io/blog/tag/python)   /  [How to fix Python requests SSLError?](https://scrapfly.io/blog/answers/python-requests-exception-sllerror)   # How to fix Python requests SSLError?

 by [Bernardas Alisauskas](https://scrapfly.io/blog/author/bernardas) Dec 19, 2022 1 min read [\#python](https://scrapfly.io/blog/tag/python) [\#requests](https://scrapfly.io/blog/tag/requests) 

 [  ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fpython-requests-exception-sllerror "Share on LinkedIn")    

 

 

`SSLError` error is seen when using Python [requests](https://pypi.org/project/requests/) module to scrape pages with untrusted SSL certificates.

python```python
import requests
response = requests.get("https://example.com/")
# raises: 
# SSLError: HTTPConnectionPool(host='example.com', port=80)...

# we can disable certificate verficiation (note: dangerous as it disables e2e encryption)
response = requests.get("https://example.com/", verify=False)
# or specify certficate file explicitly (.rem)
cert_location = "certificates/example-com-certificate.pem"
response = requests.get("https://example.com/", verify=cert_location)
```



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.

Note if manual fix is required the SSL certificates `requests` is using can be found using the `requests.certs.where()` method:

python```python
import requests
print(requests.certs.where())
'/etc/ssl/certs/ca-certificates.crt'  # example on Linux
```



This value can also be overridden using `REQUESTS_CA_BUNDLE` environment variable:

shell```shell
$ export REQUESTS_CA_BUNDLE="/etc/ssl/certs/my-certificates.pem" 
$ python -c "import requests;print(requests.certs.where())"
/ets/ssl/certs/my-certificates.pem
```



Finally, `requests` is using [certifi](https://pypi.org/project/certifi/) to handle all SLL certificate-related operations - try updating it: `pip install certifi --upgrade`



 

    



Scale Your Web Scraping

Anti-bot bypass, browser rendering, and rotating proxies, all in one API. Start with 1,000 free credits.

  No credit card required  1,000 free API credits  Anti-bot bypass included 

 [Start Free](https://scrapfly.io/register) [View Docs](https://scrapfly.io/docs/onboarding) 

 Not ready? Get our newsletter instead. 

 

## Explore this Article with AI

 [ ChatGPT ](https://chat.openai.com/?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fpython-requests-exception-sllerror) [ Gemini ](https://www.google.com/search?udm=50&aep=11&q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fpython-requests-exception-sllerror) [ Grok ](https://x.com/i/grok?text=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fpython-requests-exception-sllerror) [ Perplexity ](https://www.perplexity.ai/search/new?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fpython-requests-exception-sllerror) [ Claude ](https://claude.ai/new?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fpython-requests-exception-sllerror) 



 ## Related Articles

 [  

 python crawling 

### How to Find All URLs on a Domain

Learn how to efficiently find all URLs on a domain using Python and web crawling. Guide on how to crawl entire domain to...

 

 ](https://scrapfly.io/blog/posts/how-to-find-all-urls-on-a-domain) [  

 http python 

### Guide to Python requests POST method

Discover how to use Python's requests library for POST requests, including JSON, form data, and file uploads, along with...

 

 ](https://scrapfly.io/blog/posts/how-to-python-requests-post) [     

### How to Use cURL to Download Files

Curlhttps://curl.se/, short for "Client URL," is a versatile command-line tool used for transferring data with URLs. It'...

 

 ](https://scrapfly.io/blog/posts/how-to-curl-download-file) 

  ## Related Questions

- [ Q How to fix Python requests ReadTimeout error? ](https://scrapfly.io/blog/answers/python-requests-exception-readtimeout)
- [ Q How to fix python requests ConnectTimeout error? ](https://scrapfly.io/blog/answers/python-requests-exception-connecttimeout)
- [ Q How to fix Python requests MissingSchema error? ](https://scrapfly.io/blog/answers/python-requests-exception-missingschema)
- [ Q How to install mitmproxy certificate on Chrome and Chromium? ](https://scrapfly.io/blog/answers/how-to-install-mitmproxy-certificate)
 
  



   



 Scale your web scraping effortlessly, **1,000 free credits** [Start Free](https://scrapfly.io/register)