Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

How i can ignore ssl certification on python?

avatar
New Contributor

I am trying to run an example from the cloudera documentation site in python. I am getting ssl certificate error:

 

ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)

 

Getting a certificate is not a solution to my problem. Can I ignore the certificate validation when accessing the api, similar to how it can be done through a regular request?

 

For example:

 

import requests
res = requests.get(url, auth=(login, pass), timeout= 1000000, verify= False)

 

 

my code:

 

import cm_client

cm_client.configuration.username = login
cm_client.configuration.password = pass

api_url = api_host + ':' + port + '/api/' + api_version
api_client = cm_client.ApiClient(api_url)
cluster_api_instance = cm_client.ClustersResourceApi(api_client)

 

 

4 REPLIES 4

avatar
Expert Contributor

Hi @mananasaly refer below stackoverflow discussion, this may help you to bypass ssl certificate in python

https://stackoverflow.com/questions/15445981/how-do-i-disable-the-security-certificate-check-in-pyth...

Let us know if this helps

avatar
New Member

Hello, @mananasaly, the SSL certificate error in Python you are getting can occur due to when making HTTPS requests using the requests module in Python. To solve the error, I found the reference guide from:- https://cheapsslweb.com/blog/ssl-certificate-verify-failed-error-in-python/. You can refer to it, maybe it will be helpful to solve the error.

I hope it helps!

avatar
New Member

You can bypass SSL verification in Python using:

import requests
response = requests.get('https://your-url.com', verify=False)

However, disabling SSL verification is not recommended for production as it exposes you to security risks.

If you're facing a CERTIFICATE_VERIFY_FAILED error, it's better to fix the underlying certificate issue. Here's a detailed guide: https://sslinsights.com/fix-certificate-verify-failed-error-in-python/

Hope it helps!

avatar
New Member

You can bypass SSL verification in Python using:

import requests
response = requests.get('https://your-url.com', verify=False)

However, disabling SSL verification is not recommended for production as it exposes you to security risks. If you're facing a CERTIFICATE_VERIFY_FAILED error, it's better to fix the underlying certificate issue. Here's a detailed guide: https://sslinsights.com/fix-certificate-verify-failed-error-in-python/