SSL_CTX_set_msg_callback.3 revision 279265
Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)

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 turned on, 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 "2015-01-08" "0.9.8zd" "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_get_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" \fISSL_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. SSL_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.

\fISSL_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 \fISSL_new\|(3). SSL_set_msg_callback() and \fISSL_set_msg_callback_arg() modify the actual settings of an \s-1SSL\s0 object. Using a 0 pointer for cb disables the message callback.

When cb is called by the \s-1SSL/TLS\s0 library for a protocol message, 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. Currently, this is one of \fB\s-1SSL2_VERSION\s0, \s-1SSL3_VERSION\s0 and \s-1TLS1_VERSION\s0 (for \s-1SSL 2.0, SSL 3.0\s0 and \s-1TLS 1.0,\s0 respectively).
"content_type" 4
Item "content_type" In the case of \s-1SSL 2.0,\s0 this is always 0. In the case of \s-1SSL 3.0\s0 or \s-1TLS 1.0,\s0 this is one of the ContentType values defined in the protocol specification (change_cipher_spec(20), alert(21), \fBhandshake(22); but never application_data(23) because the callback will only be called for protocol messages).
"buf, len" 4
Item "buf, len" \fIbuf points to a buffer containing the protocol message, 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 \fISSL_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.

"SEE ALSO"
Header "SEE ALSO" \fIssl\|(3), SSL_new\|(3)
"HISTORY"
Header "HISTORY" \fISSL_CTX_set_msg_callback(), SSL_CTX_set_msg_callback_arg(), \fISSL_set_msg_callback() and SSL_get_msg_callback_arg() were added in OpenSSL 0.9.7.