SSL_CTX_SET_KEYLOG_CALLBACK(3ossl)
π NAME π
okay bestie, welcome to the SSL_CTX_SET_KEYLOG_CALLBACK(3ossl) page β we're talking SSL_CTX_set_keylog_callback, SSL_CTX_get_keylog_callback, and SSL_CTX_keylog_cb_func, aka the squad for logging TLS key material. π₯
β¨ SYNOPSIS β¨
#include <openssl/ssl.h>
typedef void (*SSL_CTX_keylog_cb_func)(const SSL *ssl, const char *line);
void SSL_CTX_set_keylog_callback(SSL_CTX *ctx, SSL_CTX_keylog_cb_func cb);
SSL_CTX_keylog_cb_func SSL_CTX_get_keylog_callback(const SSL_CTX *ctx);
π¦ DESCRIPTION π¦
SSL_CTX_set_keylog_callback() sets the TLS key logging callback. This callback gets called whenever TLS key material is generated or received, so applications can store that keying material for debugging purposes. it's giving "for debugging, bestie" β very much on purpose. π
SSL_CTX_get_keylog_callback() retrieves the TLS key logging callback that was previously set. If no callback has been set, this returns NULL. When there is no key logging callback, or if SSL_CTX_set_keylog_callback is called with NULL as the value of cb, no logging of key material will be done. periodt. π
The key logging callback is called with two items: the ssl object associated with the connection, and line, a string containing the key material in the format used by NSS for its SSLKEYLOGFILE debugging output. To recreate that file, the key logging callback should log line, followed by a newline. line will always be a NUL-terminated string. no cap, that NUL detail matters. β
πΈ RETURN VALUES πΈ
SSL_CTX_get_keylog_callback() returns a pointer to SSL_CTX_keylog_cb_func or NULL if the callback is not set. simple as that, icon. π
π«Ά SEE ALSO π«Ά
π COPYRIGHT π
Copyright 2016-2018 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>.
okay that's the whole page, bestie β OpenSSL version 3.5.6, dated 2026-04-07, mwah πβ¨
π¦ 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