SSL_GET_VERIFY_RESULT(3SSL)
π SSL_GET_VERIFY_RESULT π
okay bestie, welcome to the SSL_get_verify_result(3SSL) page from the OpenSSL fam πΈ this one's short and sweet but it has β¨loreβ¨ so let's get into it
π NAME π
SSL_get_verify_result β get result of peer certificate verification
like... did the cert pass the vibe check or not π
β¨ SYNOPSIS β¨
#include <openssl/ssl.h>
long SSL_get_verify_result(const SSL *ssl);
π¦ DESCRIPTION π¦
So SSL_get_verify_result() returns the result of the verification of the X509 certificate that the peer presented β if any. That's it, that's the function π
β οΈ okay but fr fr:sslMUST NOT beNULL. Not a suggestion, not a vibe, a requirement. Do not passNULL. π
π NOTES π
ngl this is the part where it gets real. SSL_get_verify_result() can only return one error code, but the verification of a certificate can fail because of many reasons at the same time π so unfair. Only the last verification error that occurred during the processing is available from SSL_get_verify_result().
Sometimes there can be a whole sequence of errors leading to the verification failure as reported by SSL_get_verify_result(). So if you want all of them (the full receipts π), you have to setup a verify callback via SSL_CTX_set_verify(3) or SSL_set_verify(3) and retrieve the errors from the error stack there, because once SSL_connect(3) returns, these errors may no longer be available. it's giving "you had to be there" energy π
The verification result is part of the established session and is restored when a session is reused. okay so it remembers. main character continuity β¨
π BUGS π
Bestie. Listen. If no peer certificate was presented, the returned result code is X509_V_OK. This is because no verification error occurred β it does however not indicate success. NOT. SUCCESS. π¨
So SSL_get_verify_result() is only useful in connection with SSL_get_peer_certificate(3). Do not let X509_V_OK gaslight you into thinking everything's fine when nobody even showed up with a cert π€
π RETURN VALUES π
The following return values can currently occur:
X509_V_OKβ the verification succeeded, or no peer certificate was presented. (yes those are two very different situations sharing one value, iykyk π)- Any other value β documented in
openssl-verify(1).
π«Ά SEE ALSO π«Ά
π COPYRIGHT π
Copyright 2000-2023 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
okay that's the whole thing, you ate it, go verify some certs responsibly π thank u for coming to my ted talk, brought to you by version 4.0.3, dated 2026-09-29 β the SSL_GET_VERIFY_RESULT(3SSL) era πβ¨π¦
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms