SSL Certificate error

Hi,

I’ve created a python virtual environment to develop my script.
However when i run the script I get this error:

HTTPSConnectionPool(host='api.pinecone.io', port=443): Max retries exceeded with url: /indexes (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)'))).

When i run the same code outside this environement everything works fine.

Can you help me?
Thanks
Damiano

Hello @damiano.tedoldi

The error message means that the client cannot verify the certificate being used by Pinecone. This can be several different causes:

  • A proxy is being used, and it’s the certificate of the proxy that cannot be validated
  • The environment is missing the CA certificates. Like using an old operating system or having a minmal Linux install.

Google signs the certificates Pinecone used. Here is the full chain:

Certificate chain                                                                            
 0 s:CN=api.pinecone.io                                                                      
   i:C=US, O=Google Trust Services LLC, CN=GTS CA 1D4           
   a:PKEY: rsaEncryption, 2048 (bit); sigalg: RSA-SHA256        
   v:NotBefore: Apr 15 20:09:09 2024 GMT; NotAfter: Jul 14 21:03:54 2024 GMT
 1 s:C=US, O=Google Trust Services LLC, CN=GTS CA 1D4           
   i:C=US, O=Google Trust Services LLC, CN=GTS Root R1          
   a:PKEY: rsaEncryption, 2048 (bit); sigalg: RSA-SHA256        
   v:NotBefore: Aug 13 00:00:42 2020 GMT; NotAfter: Sep 30 00:00:42 2027 GMT
 2 s:C=US, O=Google Trust Services LLC, CN=GTS Root R1          
   i:C=BE, O=GlobalSign nv-sa, OU=Root CA, CN=GlobalSign Root CA
   a:PKEY: rsaEncryption, 4096 (bit); sigalg: RSA-SHA256        
   v:NotBefore: Jun 19 00:00:42 2020 GMT; NotAfter: Jan 28 00:00:42 2028 GMT

I would expect the Google CA to be included in most if not all morden operating systems.

  • Can you explain how the environment is setup?
  • Do you know for CAs are available?

There are “n” number of causes that can act as the reason behind the occurrence of the python requests ssl certificate_verify_failed error. Here i’ve mentioned most expected reasons:

  1. Expired or Invalid SSL Certificate
  2. The issue with the SSL Certificate Chain
  3. Obsolete Python default certificates

After verify of these, still facing an issue, then this link https://cheapsslweb.com/blog/ssl-certificate-verify-failed-error-in-python will help you to get some of resolving methods