5 SSL_CTX_set_keylog_callback, SSL_CTX_get_keylog_callback,
6 SSL_CTX_keylog_cb_func - logging TLS key material
10 #include <openssl/ssl.h>
12 typedef void (*SSL_CTX_keylog_cb_func)(const SSL *ssl, const char *line);
14 void SSL_CTX_set_keylog_callback(SSL_CTX *ctx, SSL_CTX_keylog_cb_func cb);
15 SSL_CTX_keylog_cb_func SSL_CTX_get_keylog_callback(const SSL_CTX *ctx);
19 SSL_CTX_set_keylog_callback() sets the TLS key logging callback. This callback
20 is called whenever TLS key material is generated or received, in order to allow
21 applications to store this keying material for debugging purposes.
23 SSL_CTX_get_keylog_callback() retrieves the previously set TLS key logging
24 callback. If no callback has been set, this will return NULL. When there is no
25 key logging callback, or if SSL_CTX_set_keylog_callback is called with NULL as
26 the value of cb, no logging of key material will be done.
28 The key logging callback is called with two items: the B<ssl> object associated
29 with the connection, and B<line>, a string containing the key material in the
30 format used by NSS for its B<SSLKEYLOGFILE> debugging output. To recreate that
31 file, the key logging callback should log B<line>, followed by a newline.
32 B<line> will always be a NULL-terminated string.
41 Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved.
43 Licensed under the OpenSSL license (the "License"). You may not use
44 this file except in compliance with the License. You can obtain a copy
45 in the file LICENSE in the source distribution or at
46 L<https://www.openssl.org/source/license.html>.