close

[Solved] certificate verify failed: unable to get local issuer certificate

Hello Guys, How are you all? Hope You all Are Fine. Today I am just trying to use request package but I am facing following error certificate verify failed: unable to get local issuer certificate in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How certificate verify failed: unable to get local issuer certificate Error Occurs ?

I am just trying to use request package but I am facing following error.

requests.exceptions.SSLError:

HTTPSConnectionPool(host='www.xxxxxx.com', port=443):

Max retries exceeded with url: xxxxxxxx (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]

certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)')))

How To Solve certificate verify failed: unable to get local issuer certificate Error ?

  1. How To Solve certificate verify failed: unable to get local issuer certificate Error ?

    To Solve certificate verify failed: unable to get local issuer certificate Error First of all Find the path where cacert.pem is located Just use certifi.where() and it will give you full path. Then Open the URL on a browser. Download the chain of certificates from the URL and save as Base64 encoded .cer files Now you have to open the cacert.pem in a notepad and just add every downloaded certificate contents (—Begin Certificate— *** —End Certificate—) at the end.

  2. certificate verify failed: unable to get local issuer certificate

    To Solve certificate verify failed: unable to get local issuer certificate Error First of all Find the path where cacert.pem is located Just use certifi.where() and it will give you full path. Then Open the URL on a browser. Download the chain of certificates from the URL and save as Base64 encoded .cer files Now you have to open the cacert.pem in a notepad and just add every downloaded certificate contents (—Begin Certificate— *** —End Certificate—) at the end.

Solution 1: Add the certificates in cacert.pem

  1. First of all Find the path where cacert.pem is located
  2. Just use certifi.where() and it will give you full path.
  3. Then Open the URL on a browser. Download the chain of certificates from the URL and save as Base64 encoded .cer files
  4. Now you have to open the cacert.pem in a notepad and just add every downloaded certificate contents (---Begin Certificate--- *** ---End Certificate---) at the end.

Solution 2: update the Certificate using pip

You just need to update the Certificate using pip. Just use this command.

pip install --upgrade certifi

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Please Rate Our Solution to Motivate Us For Give Our Best

Leave a Comment