SSL_CTX_GET_VERIFY_MODE(3ossl)
β¨ SSL_CTX_get_verify_mode β¨
okay bestie, so this is the OpenSSL 3ossl manual page for the little "getter" squad β the six functions that tell you what verification settings are currently in play. It's giving "peek behind the curtain, no cap." π
πΈ NAME πΈ
SSL_CTX_get_verify_mode, SSL_get_verify_mode, SSL_CTX_get_verify_depth, SSL_get_verify_depth, SSL_get_verify_callback, SSL_CTX_get_verify_callback β get currently set verification parameters π«Ά
Literally a whole friend group of functions whose only job is to read back the verification settings you (or your defaults) already put there. They get. They don't set. Know the difference, iykyk. π₯
π SYNOPSIS π
#include <openssl/ssl.h>
int SSL_CTX_get_verify_mode(const SSL_CTX *ctx);
int SSL_get_verify_mode(const SSL *ssl);
int SSL_CTX_get_verify_depth(const SSL_CTX *ctx);
int SSL_get_verify_depth(const SSL *ssl);
int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))(int, X509_STORE_CTX *);
int (*SSL_get_verify_callback(const SSL *ssl))(int, X509_STORE_CTX *);
no cap, those last two are the ones that look like they were written by a cryptographer having a moment. They return a function pointer β the callback itself. So read them slow. π’
π DESCRIPTION π
okay so, six functions, and honestly the pattern is so clean it's iconic. Three of them want a const SSL_CTX *ctx (the whole context β the big picture), and three want a const SSL *ssl (one specific connection). Same questions, different scope. Slay. β¨
SSL_CTX_get_verify_mode()β returns the verification mode currently set inctx. πSSL_get_verify_mode()β returns the verification mode currently set inssl. πSSL_CTX_get_verify_depth()β returns the verification depth limit currently set inctx. Important caveat, bestie: if no limit has been explicitly set, it returns-1and the default value will be used. So-1is not a real depth, it's a "girl, I don't know, ask the default" situation. πSSL_get_verify_depth()β returns the verification depth limit currently set inssl. Same deal: if no limit has been explicitly set,-1is returned and the default value will be used. πSSL_CTX_get_verify_callback()β returns a function pointer to the verification callback currently set inctx. If no callback was explicitly set, theNULLpointer is returned and the default callback will be used. SoNULLis lowkey a valid answer and means "the default's got it." π§SSL_get_verify_callback()β returns a function pointer to the verification callback currently set inssl. If no callback was explicitly set, theNULLpointer is returned and the default callback will be used. Same energy, per-connection edition. π¦
the pattern here is the main character:ctxversions for the shared context,sslversions for the individual connection, and both of the "not set" cases fall back to defaults rather than failing. That's the whole vibe check of this page. π
π RETURN VALUES π
See DESCRIPTION. That's it. That's the section. The answers are all up there β modes, depth limits (or -1), and callback pointers (or NULL). Not me making you scroll back up, but likeβ¦ scroll back up. π
β SEE ALSO β
ssl(7)SSL_CTX_set_verify(3)β the setter, aka the one that actually does the thing these getters read back. Go there if you wanna change stuff instead of just peeking. π
π COPYRIGHT π
Copyright 2000-2016 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 OpenSSL 3.5.6, dated 2026-04-07 β so go forth, read your verification params, and remember: -1 and NULL are answers, not errors. periodt. π
ππΈ
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms