SSL_CTX_GET_VERIFY_MODE(3ossl)

πŸ’– SSL_CTX_GET_VERIFY_MODE πŸ’–

okay bestie so this is an OpenSSL manual page (like, 3ossl section energy, iykyk) and it's literally just the ✨getters✨ for your verification params. no cap, it's the chill half of the pair β€” the setters live over in SSL_CTX_set_verify(3). πŸŽ€


🌸 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 πŸ¦‹

like, they peek at what's already there. they do not change anything. main character observers only. πŸ‘‘


✨ 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 *);

yes the last two return a function pointer and yes the syntax is giving "who wrote this" but it's fine, it's iconic, we love her. πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

okay so, six little getters, all vibes, all read-only. here's the tea on each one:

  • SSL_CTX_get_verify_mode() β€” hands you back the verification mode that's currently set in ctx. that's it, that's the whole job. 🫢
  • SSL_get_verify_mode() β€” same thing but for ssl. the verification mode currently set in ssl, served fresh. πŸ“
  • SSL_CTX_get_verify_depth() β€” returns the verification depth limit currently set in ctx. and here's the important bit bestie: if no limit has been explicitly set, you get -1 back and the default value will be used. so -1 isn't a real depth, it's a "girl idk, default" signal. πŸ™ˆ
  • SSL_get_verify_depth() β€” the ssl twin. returns the verification depth limit currently set in ssl, and again: if no limit has been explicitly set, -1 comes back and the default value will be used. ⭐
  • SSL_CTX_get_verify_callback() β€” returns a function pointer to the verification callback currently set in ctx. if no callback was explicitly set, you get the NULL pointer and the default callback will be used. so NULL = "not me, the default one is handling it". πŸ’€
  • SSL_get_verify_callback() β€” you already know. returns a function pointer to the verification callback currently set in ssl, and if no callback was explicitly set, NULL is returned and the default callback will be used. 🌈

so like, tl;dr: modes and depths come back as int, callbacks come back as a function pointer, and the "nothing was set" states are -1 for depth and NULL for the callback. the defaults swoop in to save the day in both cases. 🧚


πŸ”₯ RETURN VALUES πŸ”₯

See DESCRIPTION. literally. that's the whole section. go back up, bestie, it's all up there. πŸ‘†


πŸ¦‹ SEE ALSO πŸ¦‹


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 page!! πŸ’… version 3.5.9, dated 2026-09-29, straight out of the OpenSSL universe β€” go set some verify params and then come back here to read them, slay, periodt. πŸŽ€βœ¨πŸ’–

πŸ“¦ where this page comes from