SSL errors
When connecting to the Treble SDK on a corporate network users might experience errors with the SSL connection. This is caused by firewalls or proxy servers set up by the network administrators of the organization. Instead of connecting to the Treble SDK endpoint, the SDK has to go through a middle server which the network layer of the SDK client does not recognize.
Fixes
There are a few solutions we can try to mitigate the issue before we involve your local network administartor.
Prerequisites
Ensure you have Python 3.10+ installed.
Confirm that your connection to https://stapi.treble.tech is secure in your web browser.
Install the truststore Python package:
pip install truststore
Then follow the instructions for your operations system:
- Windows
- Mac
- Linux
Choose one of the following methods:
- Option A: Set the environment variable
TSDK_USE_TRUSTSTORE=1
before importing the SDK. - Option B: Add the following lines to your script before starting the SDK session:
import truststore
truststore.inject_into_ssl()
Choose one of the following methods:
- Option A: Set the environment variable
TSDK_USE_TRUSTSTORE=1
before importing the SDK. - Option B: Add the following lines to your script before starting the SDK session:
import truststore
truststore.inject_into_ssl()
Obtain the necessary SSL certificates from your IT department or export them from your web browser.
Steps to Install and Trust Certificates
- Copy the certificate files to the following directory:
sudo cp /path/to/certificate.crt /usr/local/share/ca-certificates/
- Ensure the file extension is .crt (If the file is .pem, you can usually rename it to .crt).
- Update the system’s certificate store:
sudo update-ca-certificates
The output should include a confirmation such as:
X added, 0 removed; done.
where X is the number of certificates added.
- Choose one of the following methods to enable trust:
Option A: Set the environment variable TSDK_USE_TRUSTSTORE=1 before importing the SDK.
Option B: Add the following lines before starting the SDK session:
import truststore
truststore.inject_into_ssl()
If these instuctions do not solve your SSL issues, please consult with your network administrators and the Treble support team to resolve the problem.