1SSL_accept(3) OpenSSL SSL_accept(3)
2
3
4
6 SSL_accept - wait for a TLS/SSL client to initiate a TLS/SSL handshake
7
9 #include <openssl/ssl.h>
10
11 int SSL_accept(SSL *ssl);
12
14 SSL_accept() waits for a TLS/SSL client to initiate the TLS/SSL
15 handshake. The communication channel must already have been set and
16 assigned to the ssl by setting an underlying BIO.
17
19 The behaviour of SSL_accept() depends on the underlying BIO.
20
21 If the underlying BIO is blocking, SSL_accept() will only return once
22 the handshake has been finished or an error occurred, except for SGC
23 (Server Gated Cryptography). For SGC, SSL_accept() may return with -1,
24 but SSL_get_error() will yield SSL_ERROR_WANT_READ/WRITE and
25 SSL_accept() should be called again.
26
27 If the underlying BIO is non-blocking, SSL_accept() will also return
28 when the underlying BIO could not satisfy the needs of SSL_accept() to
29 continue the handshake, indicating the problem by the return value -1.
30 In this case a call to SSL_get_error() with the return value of
31 SSL_accept() will yield SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE.
32 The calling process then must repeat the call after taking appropriate
33 action to satisfy the needs of SSL_accept(). The action depends on the
34 underlying BIO. When using a non-blocking socket, nothing is to be
35 done, but select() can be used to check for the required condition.
36 When using a buffering BIO, like a BIO pair, data must be written into
37 or retrieved out of the BIO before being able to continue.
38
40 The following return values can occur:
41
42 1. The TLS/SSL handshake was successfully completed, a TLS/SSL
43 connection has been established.
44
45 2. The TLS/SSL handshake was not successful but was shut down
46 controlled and by the specifications of the TLS/SSL protocol. Call
47 SSL_get_error() with the return value ret to find out the reason.
48
49 3. <0
50
51 The TLS/SSL handshake was not successful because a fatal error
52 occurred either at the protocol level or a connection failure
53 occurred. The shutdown was not clean. It can also occur of action
54 is need to continue the operation for non-blocking BIOs. Call
55 SSL_get_error() with the return value ret to find out the reason.
56
58 SSL_get_error(3), SSL_connect(3), SSL_shutdown(3), ssl(3), bio(3),
59 SSL_set_connect_state(3), SSL_do_handshake(3), SSL_CTX_new(3)
60
62 Hey! The above document had some coding errors, which are explained
63 below:
64
65 Around line 52:
66 You have '=item 0' instead of the expected '=item 2'
67
68 Around line 58:
69 Expected '=item 3'
70
71
72
731.0.0e 2003-06-03 SSL_accept(3)