close

[Solved] Python requests SSL error – certificate verify failed

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Python requests SSL error – certificate verify failed 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 Python requests SSL error – certificate verify failed Error Occurs?

Today I get the following error Python requests SSL error – certificate verify failed in python.

How To Solve Python requests SSL error – certificate verify failed Error ?

  1. How To Solve Python requests SSL error – certificate verify failed Error ?

    To Solve Python requests SSL error – certificate verify failed Error cat institution-certificate.pem >> venv/lib/python3.9/site-packages/certifi/cacert.pem
    This should solve the problem if your network requires a CA

  2. Python requests SSL error – certificate verify failed

    To Solve Python requests SSL error – certificate verify failed Error cat institution-certificate.pem >> venv/lib/python3.9/site-packages/certifi/cacert.pem
    This should solve the problem if your network requires a CA

Solution 1

import requests
html = requests.get("https://hcaidcs.phe.org.uk/WebPages/GeneralHomePage.aspx",verify=False).text

You should write it like this, and I’ve verified it

Solution 2

cat institution-certificate.pem >> venv/lib/python3.9/site-packages/certifi/cacert.pem

This should solve the problem if your network requires a CA

Summery

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? Thank You.

Also, Read