4

Do you know about this error:

urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)

This error occurred on my server when I run my app which is written on python, but when I run this app on local computer for sending requests to that server it works without any error. The python app sent to https request to myhost.com/action. and the web host is working with https. I checked ssl from sslchecker and it seems ssl installed succesfully. here is checker result:enter image description here

I don't know what I must show here to explain my problem. If you have a question about code or server settings I will try to answer as I can.

** This question isn't duplicate of that one

Community
  • 1
  • 1
Ulug'bek
  • 2,762
  • 6
  • 31
  • 59

2 Answers2

3

A new ssl certification checking system is added in python 3, and one way to avoid the error of not passing certification is to nullify this mechanism:

import ssl
ssl._create_default_https_context = ssl._create_unverified_context
2

I don't know if this will work for you because i don't know your code. But i had the same problem. With this 4 lines my code work perfect:

import request

#disable ssl warning
requests.packages.urllib3.disable_warnings()
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
context.verify_mode = ssl.CERT_NONE

When you connect, set the parameter of sslContext to context.

Melody
  • 182
  • 2
  • 12