]> git.ipfire.org Git - thirdparty/openssl.git/commit
doc: Discuss calling X509_verify_cert in cert_verify_callback
authorDavid Benjamin <davidben@google.com>
Mon, 20 Oct 2025 21:38:14 +0000 (17:38 -0400)
committerTomas Mraz <tomas@openssl.org>
Mon, 24 Nov 2025 18:22:20 +0000 (19:22 +0100)
commit069181d7f39beaae22bfa67bcba3c5fe93acafd4
tree5a1e5f01ee45744cea58ccb572adb359fd09510b
parentaa0be384d8144ae48a3274cbd728e4bd27304e07
doc: Discuss calling X509_verify_cert in cert_verify_callback

Using SSL_CTX_set_cert_verify_callback but still calling
X509_verify_cert is useful if applications want to dynamically
configure the X509_STORE_CTX, or postprocess the result, in a way that
does not quite fit the somewhat unpredictable behavior of the
SSL_CTX_set_verify callback. (In my experience, applications rarely
realize it is called multiple times. It's also too late at that point to
reconfigure the X509_STORE_CTX as verification has already started.)

There is one note in the docs that the callback needs to stash the
verify result with X509_STORE_CTX_set_error, but it is not immediately
obvious that X509_verify_cert will do so, or that it is the built-in
behavior. Add a paragraph discussing this.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28960)
doc/man3/SSL_CTX_set_cert_verify_callback.pod