Adding the Required SSL Certificates
If a Python script run is returning an SSL Error like below:
Â
Â
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)
Â
Â
it is likely due to the DEV or Production environment certificate not being accepted. Follow the steps below to solve it.
Â
Firstly, you need to download the certificates from DEV by visiting https://ws-sandbox.midchains.com:8081/ and prod by visiting and https://ws.midchains.com:8081/using the google chrome browser:
Â
Â
Â
Â
a. Click on the lock icon :
Â
Â
Â
Â
b. Click on the Certificate button to display the General Information:
Â
Â
Â
Â
c. Select the Details tab and export each certificate from the Certificate Hierarchy.
Â
Â
Â
Â
d. After downloading all the certificates rename Builtin Object Token:Go Daddy Root Certificate Authority - G2 to root and Go Daddy Secure Certificate Authority - G2 to subroot.
Â
Â
2. After downloading all certificates, use the command below in the terminal for each certificate to give it a proper installation format:
Â
sudo openssl x509 -inform DER -in certificate.cer -out certificate.crt
Â
3. Create a directory for extra CA certificates in /usr/share/ca-certificates
using the command below in the terminal:
sudo mkdir /usr/share/ca-certificates/extra
Â
4. Move each certificate to the above directory, using the command below in the terminal for each certificate:
Â
5. Install each certificate one after the other using the command below in the terminal :
Â
This opens an interactive window in the terminal like below:
Â
Â
Choose Yes as displayed above.
Â
Tap the space bar on the keyboard to select all the certificates in the extra directory. when the certificate is selected, a star symbol * in brackets before the certificate path like below:
Â
Â
Select all certificates and hit ok.
Â
Â
The following responses will be displayed once installation has successfully completed:
Â
Â
For non-interactive installation, run the command below in the terminal:
Â
Â
Once installation has successfully completed, the following response will be displayed:
Â
Â