# SSL Certificate Issue

**URL:** <https://discuss.huggingface.co/t/ssl-certificate-issue/51405>\
**Category:** 🤗Transformers\
**Created:** [August 20, 2023, 10:49am UTC](https://discuss.huggingface.co/t/ssl-certificate-issue/51405 "2023-08-20T10:49:42Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Himanshi-huggingface](https://avatars.discourse-cdn.com/v4/letter/h/e480ec/32.png) [@Himanshi-huggingface](https://discuss.huggingface.co/u/Himanshi-huggingface)\
**Post date:** [August 20, 2023, 10:49am UTC](https://discuss.huggingface.co/t/ssl-certificate-issue/51405/1 "2023-08-20T10:49:42Z")

</div>

**Error** : SSLError: HTTPSConnectionPool(host=‘[huggingface.co](http://huggingface.co)’, port=443): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE\_VERIFY\_FAILED] certificate verify failed: Unable to get local issuer certificate (ssl.c:997)’)))

**Python Script**

from transformers import AutoTokenizer  
from transformers import TFAutoModelForMaskedLM  
tokenizer = AutoTokenizer.from\_pretrained(‘distilroberta-base’)  
model\_checkpoint = ‘distilbert-base-uncased’  
model = TFAutoModelForMaskedLM.from\_pretrained(model\_checkpoint)  
model.summary()

**Observations:**

When we try to run the above mentioned python script where we trying to establish the connection with hugging face and using the transformer library we are facing the SSL issue .

When we checked the SSL certificate **with Domain-joined machine** , we found the **Issuer By** as **‘Cisco Umbrella’**. Please see the below image.

 ![MicrosoftTeams-image (47)](https://us1.discourse-cdn.com/hellohellohello/original/3X/e/3/e3e3503c094bd0076d0793f5c353c966137d3528.png)

When we checked the SSL certificate **without Domain-joined machine** , we found the **Issued By** as **'Amazon RSA 2048 M01 ’**.

Please have the look on the SSL certificate and if we can get the resolution and the cause of the issue. Thanks

---

<div class="post-metadata">

**Author:** ![porestar](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/porestar/32/22993_2.png) [@porestar](https://discuss.huggingface.co/u/porestar)\
**Post date:** [January 15, 2024, 9:31am UTC](https://discuss.huggingface.co/t/ssl-certificate-issue/51405/2 "2024-01-15T09:31:26Z")

</div>

I would like to bump this issue back up because we are facing the same issue in our company and effectively cant use any of the huggingface services that require us to download models due to this issue. According to our cybersecurity it can only be fixed by huggingface since whitelisting the certificate is not an option to us.  
Can you prioritize this?

---

<div class="post-metadata">

**Author:** ![irow](https://avatars.discourse-cdn.com/v4/letter/i/a4c791/32.png) [@irow](https://discuss.huggingface.co/u/irow)\
**Post date:** [January 22, 2024, 7:48pm UTC](https://discuss.huggingface.co/t/ssl-certificate-issue/51405/3 "2024-01-22T19:48:33Z")

</div>

I’m having the same issue. I can download different tokenizers, but not the actual model they belong to.

---

<div class="post-metadata">

**Author:** ![porestar](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/porestar/32/22993_2.png) [@porestar](https://discuss.huggingface.co/u/porestar)\
**Post date:** [February 16, 2024, 11:11am UTC](https://discuss.huggingface.co/t/ssl-certificate-issue/51405/5 "2024-02-16T11:11:41Z")

</div>

Any update on this @huggingface? Please update your certificates.

---

<div class="post-metadata">

**Author:** ![peter-washburn](https://avatars.discourse-cdn.com/v4/letter/p/fbc32d/32.png) [@peter-washburn](https://discuss.huggingface.co/u/peter-washburn)\
**Post date:** [February 20, 2024, 1:45pm UTC](https://discuss.huggingface.co/t/ssl-certificate-issue/51405/6 "2024-02-20T13:45:55Z")

</div>

It looks like you are behind Cisco Umbrella, which decrypts traffic from websites it deems suspicious or risky and re-encrypts it with its own certificate. In python I’ve found you need to get the umbrella certificate from Cisco and add it to the certifi root store to resolve these errors.  
Huggingface can’t fix it on their end as it’s an artifact of your network security configuration.

---

<div class="post-metadata">

**Author:** ![jiveshk](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@jiveshk](https://discuss.huggingface.co/u/jiveshk)\
**Post date:** [April 23, 2024, 11:14am UTC](https://discuss.huggingface.co/t/ssl-certificate-issue/51405/7 "2024-04-23T11:14:22Z")

</div>

2 fixes

- quick one - on windows - pip install python-certifi-win32
- preferred - install transformers package using the following command  
pip install transformers --use-feature=truststore

---

<div class="post-metadata">

**Author:** ![abhee235](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/abhee235/32/27391_2.png) [@abhee235](https://discuss.huggingface.co/u/abhee235)\
**Post date:** [May 26, 2024, 6:46am UTC](https://discuss.huggingface.co/t/ssl-certificate-issue/51405/8 "2024-05-26T06:46:47Z")

</div>

thanks man, it worked for me, shifting from colab to local PC environment can take whole day 😛

---

<div class="post-metadata">

**Author:** ![NidhiAggie](https://avatars.discourse-cdn.com/v4/letter/n/c89c15/32.png) [@NidhiAggie](https://discuss.huggingface.co/u/NidhiAggie)\
**Post date:** [January 16, 2025, 10:32am UTC](https://discuss.huggingface.co/t/ssl-certificate-issue/51405/9 "2025-01-16T10:32:10Z")

</div>

Thank you so much! It worked!

---

<div class="post-metadata">

**Author:** ![srkpmail](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/srkpmail/32/42559_2.png) [@srkpmail](https://discuss.huggingface.co/u/srkpmail)\
**Post date:** [March 5, 2025, 10:33am UTC](https://discuss.huggingface.co/t/ssl-certificate-issue/51405/10 "2025-03-05T10:33:01Z")

</div>

Awesome! It works, but can you also tell me why it work, is this library python-certi-win32 handling the download and verification of huggingface certification or its setting verify=False?

---

<div class="post-metadata">

**Author:** ![ellite24](https://avatars.discourse-cdn.com/v4/letter/e/cdc98d/32.png) [@ellite24](https://discuss.huggingface.co/u/ellite24)\
**Post date:** [April 14, 2025, 7:04am UTC](https://discuss.huggingface.co/t/ssl-certificate-issue/51405/11 "2025-04-14T07:04:59Z")

</div>

I was also facing such an error issue and got the solution guide from:- [https://cheapsslweb.com/blog/ssl-certificate-verify-failed-error-in-python/](https://cheapsslweb.com/blog/ssl-certificate-verify-failed-error-in-python/). If you face any issue in future or still getting minor error than you can also check out might it will be helpful.

---

<div class="post-metadata">

**Author:** ![hissain](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/hissain/32/37473_2.png) [@hissain](https://discuss.huggingface.co/u/hissain)\
**Post date:** [April 14, 2025, 7:29am UTC](https://discuss.huggingface.co/t/ssl-certificate-issue/51405/12 "2025-04-14T07:29:40Z")

</div>

Did you try with the following code:

```auto
import ssl
import certifi
ssl._create_default_https_context = lambda: ssl.create_default_context(cafile=certifi.where())

```

---

<div class="post-metadata">

**Author:** ![nicholaswinston](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nicholaswinston/32/45618_2.png) [@nicholaswinston](https://discuss.huggingface.co/u/nicholaswinston)\
**Post date:** [April 16, 2025, 7:51am UTC](https://discuss.huggingface.co/t/ssl-certificate-issue/51405/13 "2025-04-16T07:51:32Z")

</div>

If you’re facing an SSL certificate issue, here are some common causes and solutions to look into:

**1. Certificate Not Installed Properly**  
Make sure your SSL certificate is correctly installed on your server. You can verify this using tools like SSL Checker or [Why No Padlock](https://www.whynopadlock.com/).

**2. Mixed Content Warnings**  
Your site may be trying to load resources (like images, CSS, or scripts) over HTTP instead of HTTPS. This causes browser warnings. Use browser developer tools (F12 → Console tab) to identify and update those links to HTTPS.

**3. Certificate Expired**  
Check if your SSL certificate has expired. If so, renew it through your SSL provider or hosting panel.

**4. Domain Mismatch**  
The certificate should match the domain or subdomain you’re using. For example, a certificate for `example.com` won’t work for `www.example.com` unless it’s a wildcard or multi-domain (SAN) certificate.

**5. Not Redirecting to HTTPS**  
If your site is accessible via HTTP, set up a redirect to force HTTPS. This can be done via `.htaccess`, server config, or plugins (if using a CMS).  
Example for `.htaccess`:

apache

CopyEdit

```auto
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

```

**6. Hosting Platform Issues**  
If you’re on shared hosting or using a control panel like cPanel or Plesk, you may need to reissue or reinstall the SSL certificate. Many hosting providers support Let’s Encrypt for free SSL installation.

If you can share more details, such as your domain or the exact browser error message (e.g., “NET::ERR\_CERT\_AUTHORITY\_INVALID”), I can help you troubleshoot more specifically.

Also, let me know if you’re using a CMS (like WordPress or Magento) or a server type (Apache, NGINX, etc.) — that helps narrow down the solution.
