Mercurial > hg > orthanc
comparison OrthancFramework/UnitTestsSources/RestApiTests.cpp @ 5292:143b45791233
fix SSL unit tests
author | Alain Mazy <am@osimis.io> |
---|---|
date | Tue, 09 May 2023 18:19:15 +0200 |
parents | 0ea402b4d901 |
children | 78c59b02b121 |
comparison
equal
deleted
inserted
replaced
5291:800261398381 | 5292:143b45791233 |
---|---|
93 #if (UNIT_TESTS_WITH_HTTP_CONNEXIONS == 1) && (ORTHANC_ENABLE_SSL == 1) && (ORTHANC_SANDBOXED != 1) | 93 #if (UNIT_TESTS_WITH_HTTP_CONNEXIONS == 1) && (ORTHANC_ENABLE_SSL == 1) && (ORTHANC_SANDBOXED != 1) |
94 | 94 |
95 /** | 95 /** |
96 The HTTPS CA certificates for BitBucket were extracted as follows: | 96 The HTTPS CA certificates for BitBucket were extracted as follows: |
97 | 97 |
98 (1) We retrieve the certification chain of BitBucket: | 98 (1) We retrieve the URI of the root CA of BitBucket: |
99 | 99 |
100 # echo | openssl s_client -showcerts -connect www.bitbucket.org:443 | 100 # echo | openssl s_client -servername bitbucket.org -connect bitbucket.org:443 2>/dev/null | openssl x509 -text | grep "CA Issuers" |
101 | 101 |
102 (2) We see that the certification authority (CA) is | 102 (2) Once we get the URL to the CA certificate, we convert it to a C |
103 "www.digicert.com", and the root certificate is "DigiCert High | |
104 Assurance EV Root CA". As a consequence, we navigate to DigiCert to | |
105 find the URL to this CA certificate: | |
106 | |
107 firefox https://www.digicert.com/digicert-root-certificates.htm | |
108 | |
109 (3) Once we get the URL to the CA certificate, we convert it to a C | |
110 macro that can be used by libcurl: | 103 macro that can be used by libcurl: |
111 | 104 |
112 # cd UnitTestsSources | 105 # cd UnitTestsSources |
113 # ../Resources/RetrieveCACertificates.py BITBUCKET_CERTIFICATES https://cacerts.digicert.com/DigiCertTLSHybridECCSHA3842020CA1-1.crt > BitbucketCACertificates.h | 106 # python2 ../Resources/RetrieveCACertificates.py BITBUCKET_CERTIFICATES http://cacerts.digicert.com/DigiCertSHA2ExtendedValidationServerCA.crt > BitbucketCACertificates.h |
114 **/ | 107 **/ |
115 | 108 |
116 #include "BitbucketCACertificates.h" | 109 #include "BitbucketCACertificates.h" |
117 | 110 |
118 TEST(HttpClient, Ssl) | 111 TEST(HttpClient, Ssl) |