Python Certificate Verification Failed with Error "unable to get local issuer certificate"

Overview

This article explains why a script developed using the Python programming language for use with Auth0 might fail and display the following error message:

certificate verify failed: unable to get local issuer certificate

Applies To
  • Python
  • Failed Certificate Verification
Cause

To troubleshoot this issue, check which version of Python is in use and that the relevant SSL certificate is valid.

 

This type of SSL certificate_verify_failed error is often triggered by:

  • Expired Python default certificates
  • References to invalid root certificates

 

Here is a common pattern:

  1. The client receives the server's certificate.
  2. It attempts to chain that certificate back to its root (starting with any intermediate certificates in the chain).
  3. If the certificate chain proves to be valid, it will arrive at the trusted root certificate.

 

If the Python environment has been set up correctly and a valid certificate has been assigned, this chaining operation will normally succeed without error. However, if, for any reason, the chaining operation fails or the root certificate is invalid, then code execution will halt, and an error message will be displayed.
 

 

Solution

This is a generic Python issue. It is unrelated to the Auth0 product environment.

  • There could be several reasons why this type of Python certificate error may be encountered. For example, installing a valid SSL certificate into the local environment may be necessary.

Recommended content

No recommended content found...