logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SSL_CTX_set_keylog_callback, SSL_CTX_get_keylog_callback, SSL_CTX_keylog_cb_func - logging TLS key

Description

SSL_CTX_set_keylog_callback() sets the TLS key logging callback. This callback is called whenever TLS key
       material is generated or received, in order to allow applications to store this keying material for
       debugging purposes.

       SSL_CTX_get_keylog_callback() retrieves the previously set TLS key logging callback. If no callback has
       been set, this will return 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.

       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.

Name

       SSL_CTX_set_keylog_callback, SSL_CTX_get_keylog_callback, SSL_CTX_keylog_cb_func - logging TLS key
       material

Return Values

SSL_CTX_get_keylog_callback() returns a pointer to SSL_CTX_keylog_cb_func or NULL if the callback is not
       set.

See Also

ssl(7)

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

See Also