1SSL_SET_FD(3) OpenSSL SSL_SET_FD(3)
2
3
4
6 SSL_set_fd, SSL_set_rfd, SSL_set_wfd - connect the SSL object with a
7 file descriptor
8
10 #include <openssl/ssl.h>
11
12 int SSL_set_fd(SSL *ssl, int fd);
13 int SSL_set_rfd(SSL *ssl, int fd);
14 int SSL_set_wfd(SSL *ssl, int fd);
15
17 SSL_set_fd() sets the file descriptor fd as the input/output facility
18 for the TLS/SSL (encrypted) side of ssl. fd will typically be the
19 socket file descriptor of a network connection.
20
21 When performing the operation, a socket BIO is automatically created to
22 interface between the ssl and fd. The BIO and hence the SSL engine
23 inherit the behaviour of fd. If fd is nonblocking, the ssl will also
24 have nonblocking behaviour.
25
26 If there was already a BIO connected to ssl, BIO_free() will be called
27 (for both the reading and writing side, if different).
28
29 SSL_set_rfd() and SSL_set_wfd() perform the respective action, but only
30 for the read channel or the write channel, which can be set
31 independently.
32
34 The following return values can occur:
35
36 0 The operation failed. Check the error stack to find out why.
37
38 1 The operation succeeded.
39
41 SSL_get_fd(3), SSL_set_bio(3), SSL_connect(3), SSL_accept(3),
42 SSL_shutdown(3), ssl(7) , bio(7)
43
45 Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
46
47 Licensed under the OpenSSL license (the "License"). You may not use
48 this file except in compliance with the License. You can obtain a copy
49 in the file LICENSE in the source distribution or at
50 <https://www.openssl.org/source/license.html>.
51
52
53
541.1.1i 2021-01-26 SSL_SET_FD(3)