Python Requests getting SSLerror

The certificate itself for www.reporo.com (not reporo.com) is valid, but it is missing a chain certificate as shown in the report by ssllabs:

Chain issues    Incomplete
....
2   Extra download  Thawte DV SSL CA 
Fingerprint: 3ca958f3e7d6837e1c1acf8b0f6a2e6d487d6762 

The “Incomplete” and “Extra download” are the major points. Some browsers will have the missing chain certificate cached, others will do the download and other will fail. If you try the site with a fresh Firefox profile (which does not have any certificates cached) it will fail too.

You could download the missing chain certificates and use it as trusted CA certificate with the verify parameter for requests. Don’t just disable validation because then you are open to man-in-the-middle attacks.

Step by step instruction:

  • Download the missing certificate at https://ssl-tools.net/certificates/vqgvhb-thawte-dv-ssl-ca (found by searching for the fingerprint given in the report from SSLLabs). Download the file in PEM format, i.e. https://ssl-tools.net/certificates/3ca958f3e7d6837e1c1acf8b0f6a2e6d487d6762.pem.
  • Download the root certificate at https://ssl-tools.net/certificates/91c6d6ee3e8ac86384e548c299295c756c817b81.pem (also found by searching for fingerprint).
  • Cat both files together into a new file chain.pem. Make sure that each of the files did end with a valid end of line character (which they do not as downloaded). The resulting file should look like this.
  • Modify your call to

    requests.get('https://www.reporo.com/', verify = 'chain.pem')
    

Leave a Comment