openssl: Continue on UNABLE_TO_VERIFY_LEAF_SIGNATURE
We like to request that it is possible (maybe by an explicit option) to continue certificate verification even if UNABLE_TO_VERIFY_LEAF_SIGNATURE is thrown.
We are implementing the official eID-Client of the German identity card. The whole system is defined by a technical guideline of the Federal Office for Information Security. [1]
The identity card uses NFC to establish a connection between server and the card itself. These connections are also secured by TLS. It is not possible to use root-CAs from system truststore as the German eID infrastructure uses it’s own trust anchor. This trust anchor is a CVC (Card Verifiable Certificate) which is verified by the card itself. The CVC contains hash values of the allowed TLS certificates.
When we establish a secured connection via TLS we need to check certain things like certificate validity. But as we don’t have a root CA we need to ignore “UNABLE_TO_VERIFY_LEAF_SIGNATURE” error. Even though the content of the certificate MIGHT be compromised we MUST do plausibility checks (like validity) because we can approve it LATER with our received CVC. However, openssl stops the whole validation. This breaks our workflow as it would allow that an expired certificate is not fatal.
We checked mbedtls and gnutls. Those implementations throw a similar error but don’t stop the whole verification.
It is not possible to enforce all eID service providers to send the WHOLE certificate chain including the root-CA. See RFC5246 section-7.4.2.
certificate_list
This is a sequence (chain) of certificates. The sender's
certificate MUST come first in the list. Each following
certificate MUST directly certify the one preceding it. Because
certificate validation requires that root keys be distributed
independently, the self-signed certificate that specifies the root
certificate authority MAY be omitted from the chain, under the
assumption that the remote end must already possess it in order to
validate it in any case.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (17 by maintainers)
Commits related to this issue
- Allow to continue on UNABLE_TO_VERIFY_LEAF_SIGNATURE This unifies the behaviour of a single certificate with an unknown CA certificate with a self-signed certificate. The user callback can mask that ... — committed to misery/openssl by misery 4 years ago
- Allow to continue on UNABLE_TO_VERIFY_LEAF_SIGNATURE This unifies the behaviour of a single certificate with an unknown CA certificate with a self-signed certificate. The user callback can mask that ... — committed to misery/openssl by misery 4 years ago
- Allow to continue on UNABLE_TO_VERIFY_LEAF_SIGNATURE This unifies the behaviour of a single certificate with an unknown CA certificate with a self-signed certificate. The user callback can mask that ... — committed to openssl/openssl by misery 4 years ago
- Fix test_ssl_handshake() and test_ssl_alpn_negotiate() failures with OpenSSL 1.1.1i+. OpenSSL 1.1.1i changed behavior when verifying certificates with an unknown CA [1][2]. Now verification continues... — committed to apache/serf by evgenykotkov 2 years ago
In the callback you decide what OpenSSL should do: ignore the error and continue or abort. It seems that you’re telling it to ignore the error.
I’m not sure how the test works, but X509_verify_cert() should return the same if the certificate has not expired.
Fixed for me. 😃 Thank you very much!
I just grepped for all
verify_cb_cert(), and am noticing that we do this “direct return” in more places. I believe that the reasoning is that these are spots where the callback should take over the verification completely from the point in the chain, and simply return yay or nay, which then gets propagated back.I can’t tell you why we do it differently in different spots, and haven’t the time right now to dig further for the moment. It’s possible that there is no other way in some cases.