HTTPSConnectionPool(host='sandvik.peakon.com', port=443): Max retries exceeded with url: /api/v1/seg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2024 09:40 AM
while connecting to an api from databricks notebook with the bearer token I am getting the below error
HTTPSConnectionPool(host='sandvik.peakon.com', port=443): Max retries exceeded with url: /api/v1/segments?page=1 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)'))).
Can anyone please help me out if any workaround can be done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 10:33 PM
Hi All,
Kindly help me on the above request. Please let me know if anyone has faced any such issues earlier. the API has installed an SSL certificate but after this I am not able to connect to the API and getting the above error. How can I connect to the API from Databricks notebook.
Many thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 11:27 PM
Hi @SunilSamal
The error you are encountering, SSLCertVerificationError, indicates that the SSL certificate verification failed because the local issuer certificate could not be obtained. This is a common issue when the SSL certificate chain is incomplete or the local system does not trust the certificate authority.
Here are a few steps you can take to resolve this issue:
- Verify SSL Certificates: Ensure that the SSL certificates on the server (sandvik.peakon.com) are correctly configured and the certificate chain is complete.
- Update CA Certificates: Make sure your local system has the latest CA certificates. On some systems, you can update CA certificates using a package manager (e.g., apt-get update ca-certificates on Debian-based systems).
- Disable SSL Verification (Not Recommended for Production): If you are in a development environment and need a quick workaround, you can disable SSL verification. However, this is not recommended for production environments due to security risks. You can do this by setting the verify parameter to False in your request:
import requests
url = "https://sandvik.peakon.com/api/v1/segments?page=1"
headers = {"Authorization": "Bearer YOUR_BEARER_TOKEN"}
response = requests.get(url, headers=headers, verify=False)
print(response.json())
4.Specify a Custom CA Bundle: If you have a custom CA bundle, you can specify it in your request:
import requests
url = "https://sandvik.peakon.com/api/v1/segments?page=1"
headers = {"Authorization": "Bearer YOUR_BEARER_TOKEN"}
ca_bundle_path = "/path/to/your/ca-bundle.crt"
response = requests.get(url, headers=headers, verify=ca_bundle_path)
print(response.json())
Check Databricks Configuration: If you are using Databricks, ensure that your cluster and environment are configured correctly to trust the SSL certificates. You might need to import the necessary certificates into the Databricks environment.
If the issue persists, you may want to consult with your network or security team to ensure that the SSL certificates are correctly configured and trusted by your system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 11:49 PM
Thanks Sai for the response.
I tried with all the above options. But still getting the same error.

