Python Certificate Verification Failed

Problem statement

A customer has developed a script in the Python programming language for use with Auth0:

The script failed and the following error message was displayed within the output string:

certificate verify failed: unable to get local issuer certificate

Explain why this might be happening and whether it is related to Auth0.

Troubleshooting

Check which version of Python is in use and that the relevant SSL certificate is valid.

Cause

  • 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.
  • As this issue is unrelated to Auth0, it is recommended to enter this phrase into a search engine:

python "certificate verify failed: unable to get local issuer certificate"

A web search will deliver a range of suggestions to help fix the problem.

1 Like