0

Question: How can I force OpenSSL to use the same certificate validation algorithm used by the Chrome Browser and SSL Labs?

Details:

The certificate chain sent by "adswizz.com" includes a recently expired certificate from COMODO (expired May 30, 2020).

This OpenSSL command uses a simple algorithm that walks the cert-chain provided by the server, finds the expired certificate, and then reports "Verify return code: 10 (certificate has expired)".

openssl s_client -showcerts -connect adswizz.com:443 -servername adswizz.com < /dev/null

In contrast, visiting this SSL Labs URL shows the results from a more sophisticated algorithm that explores several different paths attempting to validate the server certificate.

https://www.ssllabs.com/ssltest/analyze.html?d=adswizz.com

This finds 3 possible paths (see image below). Path #2 is the same path used by OpenSSL, so it fails due to the expired certificate, ... but Paths #1 and #3 both succeed. (Path #3 even downloads an additional certicate!)

We want to use openssl from the Linux command line, and use the glib-openssl library to support TLS communication with the server. What command-line options or library config settings can we use to force OpenSSL to validate a certificate and get the same result as the Chrome Browser.

We cannot force the 3rd party running the adswizz.com to update its certificate chain because they will "check" using Chrome and tell is, "Looks valid", ... but OpenSSL will still fail.

We need a fix or a workaround. Any ideas?

Any help would be appreciated.

# openssl s_client -showcerts -connect adswizz.com:443 -servername adswizz.com < /dev/null

CONNECTED(00000003)
depth=3 C = SE, O = AddTrust AB, OU = AddTrust External TTP Network, CN = AddTrust External CA Root
verify error:num=10:certificate has expired
notAfter=May 30 10:48:38 2020 GMT
---
Certificate chain
 0 s:/OU=Domain Control Validated/OU=PositiveSSL Wildcard/CN=*.adswizz.com
   i:/C=GB/ST=Greater Manchester/L=Salford/O=Sectigo Limited/CN=Sectigo RSA Domain Validation Secure Server CA
-----BEGIN CERTIFICATE-----
MIIGczCCBVugAwIBAgIRAJmRcvO1sqghu6YYUOklMpQwDQYJKoZIhvcNAQELBQAw
gY8xCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO
BgNVBAcTB1NhbGZvcmQxGDAWBgNVBAoTD1NlY3RpZ28gTGltaXRlZDE3MDUGA1UE
AxMuU2VjdGlnbyBSU0EgRG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LnNlY3RpZ28uY29tMCUGA1Ud
EQQeMByCDSouYWRzd2l6ei5jb22CC2Fkc3dpenouY29tMIIBfgYKKwYBBAHWeQIE
AgSCAW4EggFqAWgAdgD2XJQv0XcwIhRUGAgwlFaO400TGTO/3wwvIAvMTvFk4wAA
AWxm2QUzAAAEAwBHMEUCIG2FdFKVcP6FgVA5gkUNP6ls31EboxWMNik2/Tru3C43
AiEAsAz8L6f+gjVseGTVuvspo/tOk4VxgaKTHXK11v/6HtUAdgBElGUusO7Or8RA
B9io/ijA2uaCvtjLMbU/0zOWtbaBqAAAAWxm2QVWAAAEAwBHMEUCIFAvLKuzf5Uy
aNmVZdwOCFuYecyR4Kwctz/2AQRgZmDGAiEA1t07AXCqPvalErjRmwOo59OAVHbb
HOepcehNTZ2IA8AAdgBVgdTCFpA2AUrqC5tXPFPwwOQ4eHAlCBcvo6odBxPTDAAA
AWxm2QUrAAAEAwBHMEUCIGh/Js6dAEY3HeZc9e44yqsJH3csigoMO2MssiwyiP5o
AiEAtDtdZqnRoa8fFIT+JGOBHpWQ9Z8K2OSjTyPuEIFIcW0wDQYJKoZIhvcNAQEL
BQADggEBAEetlFBbQLc6UrYowsuEux308+gDuuz+RuA15NsLBRaMpbz9ymXqad/y
i2xP5oCR/D393bLg4OCjje0ukUF9J4JaF7GKwp8smqP5oqDoIy4F+7E23AHU5RWL
tS5br0lKMYBS/eZddDjYYHD6AIFKzRlpEJdCebIXglg1MT7E+93f2dFMZwoWybXl
aNuOUzan8n8FPA0OrH8OOwgoJkS1SxKrpdXI9FdgogPrILa5nvyLecUT/b4Otxwz
Jm4vkHILWCn8XkhmmXbDg12yGMdRIWQdihlGuNDt97/k0+8HR9MyZ39SiJYvJQRg
TYOEC267rxGKU4TxkQJjIFScICbXZrU=
-----END CERTIFICATE-----
 1 s:/C=GB/ST=Greater Manchester/L=Salford/O=Sectigo Limited/CN=Sectigo RSA Domain Validation Secure Server CA
   i:/C=US/ST=New Jersey/L=Jersey City/O=The USERTRUST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KGOHQ+SwMj4K
00u/I5sUKUErmgQfky3xxzlIPK1aEn8=
-----END CERTIFICATE-----
 2 s:/C=US/ST=New Jersey/L=Jersey City/O=The USERTRUST Network/CN=USERTrust RSA Certification Authority
   i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root
-----BEGIN CERTIFICATE-----
MIIFdzCCBF+gAwIBAgIQE+oocFv07O0MNmMJgGFDNjANBgkqhkiG9w0BAQwFADBv
MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFk
ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF
eHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFow
gYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpOZXcgSmVyc2V5MRQwEgYDVQQHEwtK
ZXJzZXkgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMS4wLAYD
VQQDEyVVU0VSVHJ1c3QgUlNBIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjAN
BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAgBJlFzYOw9sIs9CsVw127c0n00yt
UINh4qogTQktZAnczomfzD2p7PbPwdzx07HWezcoEStH2jnGvDoZtF+mvX2do2NC
tnbyqTsrkfjib9DsFiCQCT7i6HTJGLSR1GJk23+jBvGIGGqQIjy8/hPwhxR79uQf
jtTkUcYRZ0YIUcuGFFQ/vDP+fmyc/xadGL1RjjWmp2bIcmfbIWax1Jt4A8BQOujM
8Ny8nkz+rwWWNR9XWrf/zvk9tyy29lTdyOcSOk2uTIq3XJq0tyA9yn8iNK5+O2hm
AUTnAU5GU5szYPeUvlM3kHND8zLDU+/bqv50TmnHa4xgk97Exwzf4TKuzJM7UXiV
Z4vuPVb+DNBpDxsP8yUmazNt925H+nND5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validated/OU=PositiveSSL Wildcard/CN=*.adswizz.com
issuer=/C=GB/ST=Greater Manchester/L=Salford/O=Sectigo Limited/CN=Sectigo RSA Domain Validation Secure Server CA
---
No client certificate CA names sent
Peer signing digest: SHA512
Server Temp Key: ECDH, P-256, 256 bits
---
SSL handshake has read 5334 bytes and written 454 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES256-GCM-SHA384
    Session-ID: B56072247A34ED804A1B84933F673D5029E02352C1EC96109F38991BCE1DA450
    Session-ID-ctx: 
    Master-Key: 79A358537CE41E0CA4D3463848A9837397BB06B068547F702336723D42BB7DB0A788390E76F4264534D2B47EE2B1B48C
    Key-Arg   : None
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    TLS session ticket lifetime hint: 300 (seconds)
    TLS session ticket:
    0000 - 60 bb 34 9c c4 9e 1e d5-25 30 51 e8 c0 66 ad f9   `.4.....%0Q..f..
    0010 - 96 ff 5a 60 3b 9b 50 07-55 08 2b 11 5e 72 9e fb   ..Z`;.P.U.+.^r..
    0020 - b6 47 85 f1 42 27 28 ae-ce fc e0 63 c3 00 60 01   .G..B'(....c..`.
    0030 - 78 d0 6b c6 d9 40 8e 5d-96 14 a0 24 f2 4e 35 25   x.k..@.]...$.N5%
    0040 - 3e e4 94 21 c6 11 0b db-00 6b c7 16 87 c1 92 a2   >..!.....k......
    0050 - 9a c3 dc 51 95 5d 44 6f-e0 f0 20 2c 44 9e 07 e3   ...Q.]Do.. ,D...
    0060 - cb 0a 83 f2 8f 06 d8 9d-53 b8 85 a1 62 27 09 dd   ........S...b'..
    0070 - a2 74 35 31 07 71 5b 92-87 8e 84 34 c4 10 9f 01   .t51.q[....4....
    0080 - 0a 86 30 32 e4 b2 3e ed-3c c4 81 49 42 60 19 9b   ..02..>.<..IB`..
    0090 - ff 90 0b 0a a7 4b 58 ed-bd b9 6a 8a 09 3e 54 0e   .....KX...j..>T.
    00a0 - 39 ce 19 14 fb 5d b3 b6-11 a3 11 da 53 11 ff 06   9....]......S...
    00b0 - 0e 9c 1b 7f 14 ef 69 cb-35 5a 79 29 dd ed 9c 39   ......i.5Zy)...9
    00c0 - 19 e2 6a 9e d7 06 5e e7-3b 86 c1 0e cb 80 7e 6a   ..j...^.;.....~j

    Start Time: 1591065727
    Timeout   : 300 (sec)
    Verify return code: 10 (certificate has expired)
---
DONE

enter image description here

2

This OpenSSL command uses a simple algorithm that walks the cert-chain provided by the server, finds the expired certificate, and then reports "Verify return code: 10 (certificate has expired)".

While this is true for OpenSSL 1.0.2 it is no longer true for OpenSSL 1.1.1 - i.e. this version finds and uses the valid path.

Path #3 even downloads an additional certicate!

While Chrome would do this neither Firefox nor OpenSSL nor many other libraries would download missing certificates by their own.

We cannot force the 3rd party running the adswizz.com to update its certificate chain because they will "check" using Chrome and tell is, "Looks valid", ... but OpenSSL will still fail.

While it contains a grain of truth this argument is still wrong. Both servers and clients should have correct and up-to-date configuration. This means in this specific case your OpenSSL should be newer and also the server should be fixed. If the company is testing only with a single browser and ignoring problems with everything else it is risking loosing customers.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.