In documentation, consistently refer to OpenSSL 3.0
[openssl.git] / doc / man3 / SSL_CTX_set_keylog_callback.pod
1 =pod
2
3 =head1 NAME
4
5 SSL_CTX_set_keylog_callback, SSL_CTX_get_keylog_callback,
6 SSL_CTX_keylog_cb_func - logging TLS key material
7
8 =head1 SYNOPSIS
9
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
17 =head1 DESCRIPTION
18
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.
22
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.
27
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.
33
34 =head1 RETURN VALUES
35
36 SSL_CTX_get_keylog_callback() returns a pointer to B<SSL_CTX_keylog_cb_func> or
37 NULL if the callback is not set.
38
39 =head1 SEE ALSO
40
41 L<ssl(7)>
42
43 =head1 COPYRIGHT
44
45 Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
46
47 Licensed under the Apache License 2.0 (the "License").  You may not use
48 this file except in compliance with the License.  You can obtain a copy
49 in the file LICENSE in the source distribution or at
50 L<https://www.openssl.org/source/license.html>.
51
52 =cut