SSL_GET_VERIFY_RESULT(3ossl)
π SSL_GET_VERIFY_RESULT π
okay bestie, so this is the SSL_get_verify_result(3ossl) page from the OpenSSL manual, and it's literally the little function that tells you whether your peer's certificate passed the vibe check or flopped. it's short, it's iconic, let's go β¨
πΈ NAME πΈ
SSL_get_verify_result β get the result of peer certificate verification, i.e. the receipts on whether that cert was valid 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 there even was one. that's the whole job. she's simple, she's focused, she's doing one thing and doing it well π
β οΈ ssl MUST NOT be NULL. like, for real. don't do that. that's not a vibe.
β¨ NOTES β¨
okay this is the part where it gets lowkey messy, so listen up:
SSL_get_verify_result()can only hand you back one error code at a time, but cert verification can fail for like a million reasons all at once. the way that it only gives you the last verification error that happened during processing?? yeah. that's it. that's all you get from this function π- sometimes there's a whole sequence of errors that stacked up and led to the verification failure that
SSL_get_verify_result()reports. if you want to see all of them, you gotta set up a verify callback viaSSL_CTX_set_verify(3)orSSL_set_verify(3)and pull the errors off the error stack from in there β because onceSSL_connect(3)returns, those errors may no longer be available. grab them while you can, bestie, they do NOT wait around π«Ά - the verification result is part of the established session, so it gets restored when a session is reused. cute, consistent, no notes π
π BUGS π
ngl there's a little trap here and it will catch you:
if no peer certificate was presented, the returned result code is X509_V_OK. and before you start celebrating β that's because no verification error occurred. it does not mean success. it does NOT. it is not giving success energy π
so SSL_get_verify_result() is only actually useful in connection with SSL_get_peer_certificate(3). use them together or don't use them at all, fr fr.
π RETURN VALUES π
here's what can currently come back at you:
X509_V_OKβ the verification succeeded, or no peer certificate was presented. (see the BUGS section, bestie, this one's a jump scare π»)- Any other value β these are documented over in
openssl-verify(1). go read that for the full menu β¨
π 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>.
and that's the whole page, periodt π this was OpenSSL 3.5.9, dated 2026-09-29, signing off from the SSL_GET_VERIFY_RESULT(3ossl) manual. go check your certs, bestie, and stay verified πΈπ¦β¨
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms