Skip to content
Advertisement

SSL: CERTIFICATE_VERIFY_FAILED certificate verify failed

JavaScript

-> SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748)

I run this script but I got this error. How can I do it?

Advertisement

Answer

Since your URL is “an internal corporate URL” (as stated in comments), I’m guessing it uses a self-signed certificate, or is issued by a self-signed CA certificate.

If that is in fact the case, you have two options:

(1) provide the path to your corporate CA (including the complete chain of intermediate certificates, if any) to requests.get() call via verify argument:

JavaScript

or (2), disable client-side certificate verification altogether (but beware of all the security risks this entails, like a simple man-in-the-middle attacks, etc):

JavaScript

Fore completeness, the relevant verify parameter is described in requests.request() docs:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement