Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43)

Standard preamble:
========================================================================
..
..
.. Set up some character translations and predefined strings. \*(-- will
give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
double quote, and \*(R" will give a right double quote. \*(C+ will
give a nicer C++. Capital omega is used to do unbreakable dashes and
therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
nothing in troff, for use with C<>.
.tr \(*W- . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.

If the F register is >0, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.

Avoid warning from groff about undefined register 'F'.
.. .nr rF 0 . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF
Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} ========================================================================

Title "SSL_CTX_SET_MSG_CALLBACK 3"
SSL_CTX_SET_MSG_CALLBACK 3 "2021-08-24" "1.1.1l" "OpenSSL"
For nroff, turn off justification. Always turn off hyphenation; it makes
way too many mistakes in technical documents.
"NAME"
SSL_CTX_set_msg_callback, SSL_CTX_set_msg_callback_arg, SSL_set_msg_callback, SSL_set_msg_callback_arg \- install callback for observing protocol messages
"SYNOPSIS"
Header "SYNOPSIS" .Vb 1 #include <openssl/ssl.h> \& void SSL_CTX_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); void SSL_CTX_set_msg_callback_arg(SSL_CTX *ctx, void *arg); \& void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); void SSL_set_msg_callback_arg(SSL *ssl, void *arg); .Ve
"DESCRIPTION"
Header "DESCRIPTION" \fBSSL_CTX_set_msg_callback() or SSL_set_msg_callback() can be used to define a message callback function cb for observing all \s-1SSL/TLS\s0 protocol messages (such as handshake messages) that are received or sent, as well as other events that occur during processing. \fBSSL_CTX_set_msg_callback_arg() and SSL_set_msg_callback_arg() can be used to set argument arg to the callback function, which is available for arbitrary application use.

\fBSSL_CTX_set_msg_callback() and SSL_CTX_set_msg_callback_arg() specify default settings that will be copied to new \s-1SSL\s0 objects by \fBSSL_new\|(3). SSL_set_msg_callback() and \fBSSL_set_msg_callback_arg() modify the actual settings of an \s-1SSL\s0 object. Using a \s-1NULL\s0 pointer for cb disables the message callback.

When cb is called by the \s-1SSL/TLS\s0 library the function arguments have the following meaning:

"write_p" 4
Item "write_p" This flag is 0 when a protocol message has been received and 1 when a protocol message has been sent.
"version" 4
Item "version" The protocol version according to which the protocol message is interpreted by the library such as \s-1TLS1_3_VERSION\s0, \s-1TLS1_2_VERSION\s0 etc. This is set to 0 for the \s-1SSL3_RT_HEADER\s0 pseudo content type (see \s-1NOTES\s0 below).
"content_type" 4
Item "content_type" This is one of the content type values defined in the protocol specification (\s-1SSL3_RT_CHANGE_CIPHER_SPEC\s0, \s-1SSL3_RT_ALERT\s0, \s-1SSL3_RT_HANDSHAKE\s0; but never \fB\s-1SSL3_RT_APPLICATION_DATA\s0 because the callback will only be called for protocol messages). Alternatively it may be a \*(L"pseudo\*(R" content type. These pseudo content types are used to signal some other event in the processing of data (see \s-1NOTES\s0 below).
"buf, len" 4
Item "buf, len" \fIbuf points to a buffer containing the protocol message or other data (in the case of pseudo content types), which consists of len bytes. The buffer is no longer valid after the callback function has returned.
"ssl" 4
Item "ssl" The \s-1SSL\s0 object that received or sent the message.
"arg" 4
Item "arg" The user-defined argument optionally defined by \fBSSL_CTX_set_msg_callback_arg() or SSL_set_msg_callback_arg().
"NOTES"
Header "NOTES" Protocol messages are passed to the callback function after decryption and fragment collection where applicable. (Thus record boundaries are not visible.)

If processing a received protocol message results in an error, the callback function may not be called. For example, the callback function will never see messages that are considered too large to be processed.

Due to automatic protocol version negotiation, version is not necessarily the protocol version used by the sender of the message: If a \s-1TLS 1.0\s0 ClientHello message is received by an \s-1SSL 3\s0.0-only server, \fIversion will be \s-1SSL3_VERSION\s0.

Pseudo content type values may be sent at various points during the processing of data. The following pseudo content types are currently defined:

"\s-1SSL3_RT_HEADER\s0" 4
Item "SSL3_RT_HEADER" Used when a record is sent or received. The buf contains the record header bytes only.
"\s-1SSL3_RT_INNER_CONTENT_TYPE\s0" 4
Item "SSL3_RT_INNER_CONTENT_TYPE" Used when an encrypted TLSv1.3 record is sent or received. In encrypted TLSv1.3 records the content type in the record header is always \s-1SSL3_RT_APPLICATION_DATA.\s0 The real content type for the record is contained in an \*(L"inner\*(R" content type. buf contains the encoded \*(L"inner\*(R" content type byte.
"RETURN VALUES"
Header "RETURN VALUES" \fBSSL_CTX_set_msg_callback(), SSL_CTX_set_msg_callback_arg(), SSL_set_msg_callback() and SSL_set_msg_callback_arg() do not return values.
"SEE ALSO"
Header "SEE ALSO" \fBssl\|(7), SSL_new\|(3)
"HISTORY"
Header "HISTORY" The pseudo content type \s-1SSL3_RT_INNER_CONTENT_TYPE\s0 was added in OpenSSL 1.1.1.
"COPYRIGHT"
Header "COPYRIGHT" Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use this file except in compliance with the License. You can obtain a copy in the file \s-1LICENSE\s0 in the source distribution or at <https://www.openssl.org/source/license.html>.