SSL_set_fd 3 2001-04-11 0.9.9-dev OpenSSL

NAME

SSL_set_fd - connect the SSL object with a file descriptor

LIBRARY

libcrypto, -lcrypto

SYNOPSIS


 #include 


 int SSL_set_fd(SSL *ssl, int fd);
 int SSL_set_rfd(SSL *ssl, int fd);
 int SSL_set_wfd(SSL *ssl, int fd);

DESCRIPTION

_S_S_L___s_e_t___f_d_(_) sets the file descriptor ffdd as the input/output facility for the TLS/SSL (encrypted) side of ssssll. ffdd will typically be the socket file descriptor of a network connection.

When performing the operation, a ssoocckkeett BBIIOO is automatically created to interface between the ssssll and ffdd. The BIO and hence the SSL engine inherit the behaviour of ffdd. If ffdd is non-blocking, the ssssll will also have non-blocking behaviour.

If there was already a BIO connected to ssssll, _B_I_O___f_r_e_e_(_) will be called (for both the reading and writing side, if different).

_S_S_L___s_e_t___r_f_d_(_) and _S_S_L___s_e_t___w_f_d_(_) perform the respective action, but only for the read channel or the write channel, which can be set independently.

RETURN VALUES

The following return values can occur:
0 The operation failed. Check the error stack to find out why.
1 The operation succeeded.

SEE ALSO

_S_S_L___g_e_t___f_d(3), _S_S_L___s_e_t___b_i_o(3), _S_S_L___c_o_n_n_e_c_t(3), _S_S_L___a_c_c_e_p_t(3), _S_S_L___s_h_u_t_d_o_w_n(3), _s_s_l(3) , _o_p_e_n_s_s_l___b_i_o(3)