Solved

SSL: CERTIFICATE_VERIFY_FAILED when trying to run notebook "1_Authentication" under "using-cognite-python-sdk"

  • 24 January 2023
  • 5 replies
  • 259 views

Badge +5

I encountered the following SSLCertVerificationError when trying to run the example notebook "1_Authentication" under "using-cognite-python-sdk".  The authentication via interactive login was successful. 

However, it threw the SSL error when executing “client.login.status()”

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)

 

I updated “certifi” as suggested in another discussion thread, but the error still exists. I’m using Python 3.9.12.

ANy suggestion is appreciated.

icon

Best answer by Mithila Jayalath External 27 January 2023, 11:13

View original

5 replies

Userlevel 2
Badge

@Wei Wu  can you check whether if it works by disabled SSL in cognite/client/config.py in your local machine? Set self.disable_ssl to True.

self.disable_ssl: bool = True

 

Badge +5

Yes. It works after setting self.disable_ssl to True. Thanks! @Mithila Jayalath External 

Badge +2

Hi,

 

I tried both (update certifi and set  self.disable_ssl to True) but still get error:

 

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:992)

 

Any other ideas please?

 

Thank you,

Istvan

Badge +2

Hi,

Actually after restart of the IDE and having self.disable_ssl  set to True I could connect and retrieve data. What can be the issue / solution so that ssl does not need to be disabled?

 

Cheers,

Istvan

Userlevel 2
Badge

Hi @szabolcs.i.bilibok,

There are several possible causes for SSL errors when using the Cognite SDK. Some of the most common reasons include:

  • Certificate issues: SSL errors can occur when there is a problem with the SSL/TLS certificate that is being used to secure the connection. This could be due to an expired or invalid certificate, or a mismatch between the hostname in the certificate and the actual hostname of the server.
  • Network issues: SSL errors can also occur due to network issues, such as firewall rules or proxy configurations that are blocking or interfering with the SSL/TLS connection.

Since you have previously mentioned that you have updated the certificate, I think that the possible issue for your particular case should be the 2nd bullet point that I have mentioned above. I hope my answer is clear :)

Reply