TH "event2/bufferevent_ssl.h" 3 "Tue Jan 31 2017" "libevent" \" -*- nroff -*-
ad l
nh
SH NAME
event2/bufferevent_ssl.h \- OpenSSL support for bufferevents\&.

SH SYNOPSIS
br
PP
\fC#include <event2/visibility\&.h>\fP
br
\fC#include <event2/event\-config\&.h>\fP
br
\fC#include <event2/bufferevent\&.h>\fP
br
\fC#include <event2/util\&.h>\fP
br

SS "Enumerations"

in +1c
ti -1c
RI "enum \fBbufferevent_ssl_state\fP { \fBBUFFEREVENT_SSL_OPEN\fP = 0, \fBBUFFEREVENT_SSL_CONNECTING\fP = 1, \fBBUFFEREVENT_SSL_ACCEPTING\fP = 2 }
RI "\fIThe state of an SSL object to be used when creating a new SSL bufferevent\&. \fP""
br
in -1c
SS "Functions"

in +1c
ti -1c
RI "EVENT2_EXPORT_SYMBOL unsigned long \fBbufferevent_get_openssl_error\fP (struct \fBbufferevent\fP *bev)"
br
RI "\fIReturn the most recent OpenSSL error reported on an SSL bufferevent\&. \fP"
ti -1c
RI "EVENT2_EXPORT_SYMBOL struct \fBbufferevent\fP * \fBbufferevent_openssl_filter_new\fP (struct \fBevent_base\fP *base, struct \fBbufferevent\fP *underlying, struct ssl_st *ssl, enum \fBbufferevent_ssl_state\fP state, int options)"
br
RI "\fICreate a new SSL bufferevent to send its data over another bufferevent\&. \fP"
ti -1c
RI "EVENT2_EXPORT_SYMBOL int \fBbufferevent_openssl_get_allow_dirty_shutdown\fP (struct \fBbufferevent\fP *bev)"
br
RI "\fIControl how to report dirty SSL shutdowns\&. \fP"
ti -1c
RI "EVENT2_EXPORT_SYMBOL struct ssl_st * \fBbufferevent_openssl_get_ssl\fP (struct \fBbufferevent\fP *bufev)"
br
RI "\fIReturn the underlying openssl SSL * object for an SSL bufferevent\&. \fP"
ti -1c
RI "EVENT2_EXPORT_SYMBOL void \fBbufferevent_openssl_set_allow_dirty_shutdown\fP (struct \fBbufferevent\fP *bev, int allow_dirty_shutdown)"
br
ti -1c
RI "EVENT2_EXPORT_SYMBOL struct \fBbufferevent\fP * \fBbufferevent_openssl_socket_new\fP (struct \fBevent_base\fP *base, \fBevutil_socket_t\fP fd, struct ssl_st *ssl, enum \fBbufferevent_ssl_state\fP state, int options)"
br
RI "\fICreate a new SSL bufferevent to send its data over an SSL * on a socket\&. \fP"
ti -1c
RI "EVENT2_EXPORT_SYMBOL int \fBbufferevent_ssl_renegotiate\fP (struct \fBbufferevent\fP *bev)"
br
RI "\fITells a bufferevent to begin SSL renegotiation\&. \fP"
in -1c
SH "Detailed Description"
PP
OpenSSL support for bufferevents\&.


SH "Function Documentation"
PP
SS "EVENT2_EXPORT_SYMBOL unsigned long bufferevent_get_openssl_error (struct \fBbufferevent\fP * bev)"

PP
Return the most recent OpenSSL error reported on an SSL bufferevent\&.
SS "EVENT2_EXPORT_SYMBOL struct \fBbufferevent\fP* bufferevent_openssl_filter_new (struct \fBevent_base\fP * base, struct \fBbufferevent\fP * underlying, struct ssl_st * ssl, enum \fBbufferevent_ssl_state\fP state, int options)"

PP
Create a new SSL bufferevent to send its data over another bufferevent\&.
PP
\fBParameters:\fP
RS 4
\fIbase\fP An \fBevent_base\fP to use to detect reading and writing\&. It must also be the base for the underlying bufferevent\&.
br
\fIunderlying\fP A socket to use for this SSL
br
\fIssl\fP A SSL* object from openssl\&.
br
\fIstate\fP The current state of the SSL connection
br
\fIoptions\fP One or more bufferevent_options
RE
PP
\fBReturns:\fP
RS 4
A new bufferevent on success, or NULL on failure
RE
PP

SS "EVENT2_EXPORT_SYMBOL int bufferevent_openssl_get_allow_dirty_shutdown (struct \fBbufferevent\fP * bev)"

PP
Control how to report dirty SSL shutdowns\&. If the peer (or the network, or an attacker) closes the TCP connection before closing the SSL channel, and the protocol is SSL >= v3, this is a 'dirty' shutdown\&. If allow_dirty_shutdown is 0 (default), this is reported as BEV_EVENT_ERROR\&.
PP
If instead allow_dirty_shutdown=1, a dirty shutdown is reported as BEV_EVENT_EOF\&.
PP
(Note that if the protocol is < SSLv3, you will always receive BEV_EVENT_EOF, since SSL 2 and earlier cannot distinguish a secure connection close from a dirty one\&. This is one reason (among many) not to use SSL 2\&.)
SS "EVENT2_EXPORT_SYMBOL struct ssl_st* bufferevent_openssl_get_ssl (struct \fBbufferevent\fP * bufev)"

PP
Return the underlying openssl SSL * object for an SSL bufferevent\&.
SS "EVENT2_EXPORT_SYMBOL struct \fBbufferevent\fP* bufferevent_openssl_socket_new (struct \fBevent_base\fP * base, \fBevutil_socket_t\fP fd, struct ssl_st * ssl, enum \fBbufferevent_ssl_state\fP state, int options)"

PP
Create a new SSL bufferevent to send its data over an SSL * on a socket\&.
PP
\fBParameters:\fP
RS 4
\fIbase\fP An \fBevent_base\fP to use to detect reading and writing
br
\fIfd\fP A socket to use for this SSL
br
\fIssl\fP A SSL* object from openssl\&.
br
\fIstate\fP The current state of the SSL connection
br
\fIoptions\fP One or more bufferevent_options
RE
PP
\fBReturns:\fP
RS 4
A new bufferevent on success, or NULL on failure\&.
RE
PP

SS "EVENT2_EXPORT_SYMBOL int bufferevent_ssl_renegotiate (struct \fBbufferevent\fP * bev)"

PP
Tells a bufferevent to begin SSL renegotiation\&.
SH "Author"
PP
Generated automatically by Doxygen for libevent from the source code\&.