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.