2 years ago

#41932

test-img

mrtowel

Inconsistent results of certificate chain verification

I am getting inconsistent results of certificate chain verification with different OpenSSL libraries. The chain is verified successfully on MacOS using LibreSSL 2.8.3 and fails on Linux machine with OpenSSL 1.1.1 11 Sep 2018. Command used for verification:

$ openssl verify -verbose -CAfile <(cat certificate_3.pem certificate_2.pem certificate_1.pem) certificate_0.pem

certificate_0.pem is the leaf certificate.

Result on MacOS (LibreSSL 2.8.3):

certificate_0.pem: OK

Result on Linux (OpenSSL 1.1.1):

serialNumber = (…omitted…)
error 24 at 1 depth lookup: invalid CA certificate
serialNumber = (…omitted…), title = (…omitted…)
error 24 at 2 depth lookup: invalid CA certificate
error certificate_0.pem: verification failed

I suspect differences in libraries implementation - the intermediate certificates (certificate_2.pem and certificate_1.pem) in the chain do not appear to have the basicConstraints and keyUsage X509 extensions.

I would wish to verify the chain successfully with OpenSSL 1.1.1. Please advise how to do it despite missing X509 extensions.

EDIT: I've also tried:

openssl verify -verbose -CAfile certificate_3.pem -untrusted <(cat certificate_2.pem certificate_1.pem) certificate_0.pem

as suggested by @garethTheRed in comment, but it still fails.

ssl

openssl

x509

0 Answers

Your Answer

Accepted video resources