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