cancel
Showing results for 
Search instead for 
Did you mean: 
Administration & Architecture
Explore discussions on Databricks administration, deployment strategies, and architectural best practices. Connect with administrators and architects to optimize your Databricks environment for performance, scalability, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 

HTTPSConnectionPool(host='sandvik.peakon.com', port=443): Max retries exceeded with url: /api/v1/seg

SunilSamal
New Contributor II

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.

3 REPLIES 3

SunilSamal
New Contributor II

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

saikumar246
Databricks Employee
Databricks Employee

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:

  1. Verify SSL Certificates: Ensure that the SSL certificates on the server (sandvik.peakon.com) are correctly configured and the certificate chain is complete.
  2. 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).
  3. 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.

Thanks Sai for the response.

I tried with all the above options. But still getting the same error.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group