close

[Solved] ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed

Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to execute my code And I am facing some SSL related Problem ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] 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 ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed Error Occurs ?

I am trying to execute my code And I am facing some SSL related Problem.

ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)

How To Solve ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed Error ?

  1. How To Solve ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed Error ?

    To Solve ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed Error To solve this error you just need to Install Certificates.command. Just follow this step In macOS just open Macintosh HD Now Select Application Then Select Python folder ( Python3.6, Python3.7 Whatever You are using just select this folder ) Then, double click on Install Certificates.command. Now your error should be solved.

  2. ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed

    To Solve ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed Error To solve this error you just need to Install Certificates.command. Just follow this step In macOS just open Macintosh HD Now Select Application Then Select Python folder ( Python3.6, Python3.7 Whatever You are using just select this folder ) Then, double click on Install Certificates.command. Now your error should be solved.

Solution 1: Install Certificates.command.

To solve this error you just need to Install Certificates.command. Just follow this step.

  1. In macOS just open Macintosh HD
  2. Now Select Application
  3. Then Select Python folder ( Python3.6, Python3.7 Whatever You are using just select this folder )
  4. Then, double click on Install Certificates.command.
  5. Now your error should be solved.

Solution 2: use unverified

If You are not looking for verified SSL then just use unverified SSL. just add these two line in your code.

import ssl
ssl._create_default_https_context = ssl._create_unverified_context

Solution 3: Use this code

Just Use this code. This worked in all OS:

import ssl
import certifi

urlopen(request, context=ssl.create_default_context(cafile=certifi.where()))

Solution 4: install with pip

Simply install the certificates with pip.

pip install 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