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.

 

  1. 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:

 

Â