Skip to main content
Solved

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

  • January 24, 2023
  • 5 replies
  • 339 views

Forum|alt.badge.img+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.

Best answer by Mithila Jayalath

@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

 

View original
Did this topic help you find an answer to your question?

5 replies

Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img
  • Seasoned Practitioner
  • 369 replies
  • Answer
  • January 27, 2023

@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

 


Forum|alt.badge.img+5
  • Author
  • Seasoned
  • 6 replies
  • January 27, 2023

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


Forum|alt.badge.img+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


Forum|alt.badge.img+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


Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img

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


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings