SSL_GET_VERIFY_RESULT(3ossl)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 15.1

✨ SSL_GET_VERIFY_RESULT ✨

okay so bestie, this is SSL_GET_VERIFY_RESULT(3ossl) β€” the OpenSSL page about checking whether the peer's certificate actually passed the vibe check πŸ”πŸ’…

πŸŽ€ SYNOPSIS πŸŽ€

#include <openssl/ssl.h>

long SSL_get_verify_result(const SSL *ssl);

🌸 DESCRIPTION 🌸

SSL_get_verify_result() returns the result of the verification of the X509 certificate presented by the peer, if any. and like, ssl MUST NOT be NULL. no cap, that's non-negotiable 🫢

πŸ’€ NOTES πŸ’€

okay so here's the tea β˜• β€” SSL_get_verify_result() can only return one error code, but certificate verification can fail because of many reasons at the same time. so only the last verification error that occurred during the processing is available from SSL_get_verify_result(). it's giving "you only get the last text in the group chat" energy honestly 😭

sometimes there can be a sequence of errors leading to the verification failure as reported by SSL_get_verify_result(). to get the errors, it is necessary 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. like, they're gone, bestie, ghosted you πŸ‘»

the verification result is part of the established session and is restored when a session is reused. iconic behavior honestly ✨

πŸ› BUGS πŸ›

if no peer certificate was presented, the returned result code is X509_V_OK. this is because no verification error occurred β€” but it does however not indicate success. so don't get it twisted πŸ’€ SSL_get_verify_result() is only useful in connection with SSL_get_peer_certificate(3). periodt.

πŸ¦‹ RETURN VALUES πŸ¦‹

the following return values can currently occur:

  • X509_V_OK β€” the verification succeeded or no peer certificate was presented.
  • Any other value β€” documented in openssl-verify(1). go read that one next bestie, iykyk πŸ“–

πŸ‘‘ SEE ALSO πŸ‘‘

ssl(7), SSL_set_verify_result(3), SSL_get_peer_certificate(3), openssl-verify(1)

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>.


and that's the whole page, bestie πŸŽ€πŸ’– this was 3.5.6 dated 2026-04-07, brought to you by the OpenSSL girlies β€” slay, stay verified, and remember: X509_V_OK doesn't always mean what you think it means πŸ’…βœ¨

πŸ“¦ where this page comes from