Re: Certificate verification with cross signed CAs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The certificates are attached below.

The use case is client A only has ta_primary_cert.pem and client B only has ta_secondary_cert.pem

I’m trying to build a chain that the server can use (in the server hello) so that both client A and client B can successfully connect.
Since openssl verify -trusted ta_secondary_cert.pem -untrusted cross_ca_cert.pem server_cert.pem works, I not sure why adding the other untrusted ca certificate would cause verification to fail - there is still a valid path from the leaf to a trusted root.

$ openssl version
OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)
$ openssl verify -trusted ta_primary_cert.pem -untrusted ca_cert.pem server_cert.pem 
server_cert.pem: OK
$ openssl verify -trusted ta_secondary_cert.pem -untrusted cross_ca_cert.pem server_cert.pem 
server_cert.pem: OK
$ openssl verify -trusted ta_secondary_cert.pem -untrusted ca_cert.pem -untrusted cross_ca_cert.pem server_cert.pem 
C = GB, O = Acme, L = London, CN = Intermediate CA
error 20 at 1 depth lookup: unable to get local issuer certificate
error server_cert.pem: verification failed
$ openssl verify -trusted ta_secondary_cert.pem -untrusted cross_ca_cert.pem -untrusted ca_cert.pem server_cert.pem 
server_cert.pem: OK

Attachment: ca_cert.pem
Description: application/x509-ca-cert

Attachment: cross_ca_cert.pem
Description: application/x509-ca-cert

Attachment: server_cert.pem
Description: application/x509-ca-cert

Attachment: ta_primary_cert.pem
Description: application/x509-ca-cert

Attachment: ta_secondary_cert.pem
Description: application/x509-ca-cert



On 2 Jul 2024, at 01:55, Viktor Dukhovni <openssl-users@xxxxxxxxxxxx> wrote:

Please post the actual certificates in question.  Verification should
succeed regardless of which of "ca" or "alt_ca" is listed first,
*provided* both roots are trusted, your mistake is specifying only one
root, with both intermediate issuers.

If the CAs are internal CAs you control, the CA could issue certificates
containing an authority key identifier (AKID) which specifies the the
CA's issuer DN (the root CA subject).  This would ensure that the right
issuer is chosen.  In practice, you'd still want to trust both roots.

--
   Viktor.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux