1ebfedea0SLionel Sambuc=pod 2ebfedea0SLionel Sambuc 3ebfedea0SLionel Sambuc=head1 NAME 4ebfedea0SLionel Sambuc 5ebfedea0SLionel SambucSSL_set_fd - connect the SSL object with a file descriptor 6ebfedea0SLionel Sambuc 7ebfedea0SLionel Sambuc=head1 SYNOPSIS 8ebfedea0SLionel Sambuc 9ebfedea0SLionel Sambuc #include <openssl/ssl.h> 10ebfedea0SLionel Sambuc 11ebfedea0SLionel Sambuc int SSL_set_fd(SSL *ssl, int fd); 12ebfedea0SLionel Sambuc int SSL_set_rfd(SSL *ssl, int fd); 13ebfedea0SLionel Sambuc int SSL_set_wfd(SSL *ssl, int fd); 14ebfedea0SLionel Sambuc 15ebfedea0SLionel Sambuc=head1 DESCRIPTION 16ebfedea0SLionel Sambuc 17ebfedea0SLionel SambucSSL_set_fd() sets the file descriptor B<fd> as the input/output facility 18ebfedea0SLionel Sambucfor the TLS/SSL (encrypted) side of B<ssl>. B<fd> will typically be the 19ebfedea0SLionel Sambucsocket file descriptor of a network connection. 20ebfedea0SLionel Sambuc 21ebfedea0SLionel SambucWhen performing the operation, a B<socket BIO> is automatically created to 22ebfedea0SLionel Sambucinterface between the B<ssl> and B<fd>. The BIO and hence the SSL engine 23ebfedea0SLionel Sambucinherit the behaviour of B<fd>. If B<fd> is non-blocking, the B<ssl> will 24ebfedea0SLionel Sambucalso have non-blocking behaviour. 25ebfedea0SLionel Sambuc 26ebfedea0SLionel SambucIf there was already a BIO connected to B<ssl>, BIO_free() will be called 27ebfedea0SLionel Sambuc(for both the reading and writing side, if different). 28ebfedea0SLionel Sambuc 29ebfedea0SLionel SambucSSL_set_rfd() and SSL_set_wfd() perform the respective action, but only 30ebfedea0SLionel Sambucfor the read channel or the write channel, which can be set independently. 31ebfedea0SLionel Sambuc 32ebfedea0SLionel Sambuc=head1 RETURN VALUES 33ebfedea0SLionel Sambuc 34ebfedea0SLionel SambucThe following return values can occur: 35ebfedea0SLionel Sambuc 36ebfedea0SLionel Sambuc=over 4 37ebfedea0SLionel Sambuc 38*0a6a1f1dSLionel Sambuc=item Z<>0 39ebfedea0SLionel Sambuc 40ebfedea0SLionel SambucThe operation failed. Check the error stack to find out why. 41ebfedea0SLionel Sambuc 42*0a6a1f1dSLionel Sambuc=item Z<>1 43ebfedea0SLionel Sambuc 44ebfedea0SLionel SambucThe operation succeeded. 45ebfedea0SLionel Sambuc 46ebfedea0SLionel Sambuc=back 47ebfedea0SLionel Sambuc 48ebfedea0SLionel Sambuc=head1 SEE ALSO 49ebfedea0SLionel Sambuc 50ebfedea0SLionel SambucL<SSL_get_fd(3)|SSL_get_fd(3)>, L<SSL_set_bio(3)|SSL_set_bio(3)>, 51ebfedea0SLionel SambucL<SSL_connect(3)|SSL_connect(3)>, L<SSL_accept(3)|SSL_accept(3)>, 52ebfedea0SLionel SambucL<SSL_shutdown(3)|SSL_shutdown(3)>, L<ssl(3)|ssl(3)> , L<bio(3)|bio(3)> 53ebfedea0SLionel Sambuc 54ebfedea0SLionel Sambuc=cut 55