1SSL_CTX_SET_KEYLOG_CALLBACK(3) OpenSSL SSL_CTX_SET_KEYLOG_CALLBACK(3)
2
3
4
6 SSL_CTX_set_keylog_callback, SSL_CTX_get_keylog_callback,
7 SSL_CTX_keylog_cb_func - logging TLS key material
8
10 #include <openssl/ssl.h>
11
12 typedef void (*SSL_CTX_keylog_cb_func)(const SSL *ssl, const char *line);
13
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);
16
18 SSL_CTX_set_keylog_callback() sets the TLS key logging callback. This
19 callback is called whenever TLS key material is generated or received,
20 in order to allow applications to store this keying material for
21 debugging purposes.
22
23 SSL_CTX_get_keylog_callback() retrieves the previously set TLS key
24 logging callback. If no callback has been set, this will return NULL.
25 When there is no key logging callback, or if
26 SSL_CTX_set_keylog_callback is called with NULL as the value of cb, no
27 logging of key material will be done.
28
29 The key logging callback is called with two items: the ssl object
30 associated with the connection, and line, a string containing the key
31 material in the format used by NSS for its SSLKEYLOGFILE debugging
32 output. To recreate that file, the key logging callback should log
33 line, followed by a newline. line will always be a NULL-terminated
34 string.
35
37 SSL_CTX_get_keylog_callback() returns a pointer to
38 SSL_CTX_keylog_cb_func or NULL if the callback is not set.
39
41 ssl(7)
42
44 Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
45
46 Licensed under the OpenSSL license (the "License"). You may not use
47 this file except in compliance with the License. You can obtain a copy
48 in the file LICENSE in the source distribution or at
49 <https://www.openssl.org/source/license.html>.
50
51
52
531.1.1i 2021-01-26 SSL_CTX_SET_KEYLOG_CALLBACK(3)