.TH "event2/bufferevent_ssl.h" 3 "libevent-2.1.13-stable" \" -*- nroff -*-
.ad l
.nh
.SH NAME
event2/bufferevent_ssl.h \- OpenSSL support for bufferevents\&.  

.SH SYNOPSIS
.br
.PP
\fR#include <event2/visibility\&.h>\fP
.br
\fR#include <event2/event\-config\&.h>\fP
.br
\fR#include <event2/bufferevent\&.h>\fP
.br
\fR#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 }"
.br
.RI "The state of an SSL object to be used when creating a new SSL bufferevent\&. "
.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 "Return the most recent OpenSSL error reported on an SSL bufferevent\&. "
.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 "Create a new SSL bufferevent to send its data over another bufferevent\&. "
.ti -1c
.RI "EVENT2_EXPORT_SYMBOL int \fBbufferevent_openssl_get_allow_dirty_shutdown\fP (struct \fBbufferevent\fP *bev)"
.br
.RI "Control how to report dirty SSL shutdowns\&. "
.ti -1c
.RI "EVENT2_EXPORT_SYMBOL struct ssl_st * \fBbufferevent_openssl_get_ssl\fP (struct \fBbufferevent\fP *bufev)"
.br
.RI "Return the underlying openssl SSL * object for an SSL bufferevent\&. "
.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 "Create a new SSL bufferevent to send its data over an SSL * on a socket\&. "
.ti -1c
.RI "EVENT2_EXPORT_SYMBOL int \fBbufferevent_ssl_renegotiate\fP (struct \fBbufferevent\fP *bev)"
.br
.RI "Tells a bufferevent to begin SSL renegotiation\&. "
.in -1c
.SH "Detailed Description"
.PP 
OpenSSL support for bufferevents\&. 


.SH "Function Documentation"
.PP 
.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 \fBbufferevent_options\fP 
.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 \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 \fBbufferevent_options\fP 
.RE
.PP
\fBReturns\fP
.RS 4
A new bufferevent on success, or NULL on failure\&. 
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen for libevent-2\&.1\&.13-stable from the source code\&.
