SSL_CTX_GET_VERIFY_MODE(3SSL)

πŸ’– SSL_CTX_GET_VERIFY_MODE(3SSL) β€” the OpenSSL manual, but make it make sense πŸ’–

okay so bestie, you're in the OpenSSL docs and this one is literally just the "hey what's my verification setup rn" page. no setters here, only getters. we're reading, not writing. periodt. ✨


🌸 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 β€” grab the verification parameters that are currently set. that's it, that's the whole gig. πŸŽ€


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

look at those function-pointer return types, they're giving unhinged-but-correct and honestly? iconic. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

six functions, three vibes, one mission: tell you what's already configured. let's go one by one, bestie.

  • SSL_CTX_get_verify_mode() β€” hands you back the verification mode that's currently set in ctx. that's the mode living on the whole context, affecting everybody under it.
  • SSL_get_verify_mode() β€” same energy, different scope: gives you the verification mode currently set in ssl. this one's per-connection.
  • SSL_CTX_get_verify_depth() β€” returns the verification depth limit currently set in ctx. BUT if nobody ever explicitly set a limit, it comes back as -1 and the default value gets used instead. so -1 is not a real depth, it's the "no thoughts, use the default" signal. 🫢
  • SSL_get_verify_depth() β€” returns the verification depth limit currently set in ssl. and yeah, same deal: if no limit has been explicitly set, -1 is returned and the default value will be used.
  • SSL_CTX_get_verify_callback() β€” gives you a function pointer to the verification callback currently set in ctx. if no callback was explicitly set, you get the NULL pointer back and the default callback will be used. so don't panic when you see NULL, it's just the default doing its thing. 🧚
  • SSL_get_verify_callback() β€” returns a function pointer to the verification callback currently set in ssl. and yep, if no callback was explicitly set, the NULL pointer is returned and the default callback will be used. consistency, we love her.
ngl the theme here is: everything unset reports -1 or NULL, and the library quietly falls back to its defaults. no drama, just defaults. πŸ’…

⭐ RETURN VALUES ⭐

See DESCRIPTION. that's the whole section, she's short but she knows it. 😭


πŸ‘‘ SEE ALSO πŸ‘‘

(the setters live over there, this page is strictly the getters, iykyk πŸ“)


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 a wrap bestie πŸ’œ this was OpenSSL 4.0.3, dated 2026-09-29, filed under SSL_CTX_GET_VERIFY_MODE(3SSL). go set some verify params and then come right back here to read them. main character energy only. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from