diff options
Diffstat (limited to 'src/lib/libssl/man/SSL_accept.3')
| -rw-r--r-- | src/lib/libssl/man/SSL_accept.3 | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/src/lib/libssl/man/SSL_accept.3 b/src/lib/libssl/man/SSL_accept.3 new file mode 100644 index 0000000000..944fb50c28 --- /dev/null +++ b/src/lib/libssl/man/SSL_accept.3 | |||
| @@ -0,0 +1,103 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_accept.3,v 1.1 2016/11/05 15:32:20 schwarze Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: November 5 2016 $ | ||
| 5 | .Dt SSL_ACCEPT 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_accept | ||
| 9 | .Nd wait for a TLS/SSL client to initiate a TLS/SSL handshake | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft int | ||
| 13 | .Fn SSL_accept "SSL *ssl" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_accept | ||
| 16 | waits for a TLS/SSL client to initiate the TLS/SSL handshake. | ||
| 17 | The communication channel must already have been set and assigned to the | ||
| 18 | .Fa ssl | ||
| 19 | object by setting an underlying | ||
| 20 | .Vt BIO . | ||
| 21 | .Sh NOTES | ||
| 22 | The behaviour of | ||
| 23 | .Fn SSL_accept | ||
| 24 | depends on the underlying | ||
| 25 | .Vt BIO . | ||
| 26 | .Pp | ||
| 27 | If the underlying | ||
| 28 | .Vt BIO | ||
| 29 | is | ||
| 30 | .Em blocking , | ||
| 31 | .Fn SSL_accept | ||
| 32 | will only return once the handshake has been finished or an error occurred. | ||
| 33 | .Pp | ||
| 34 | If the underlying | ||
| 35 | .Vt BIO | ||
| 36 | is | ||
| 37 | .Em non-blocking , | ||
| 38 | .Fn SSL_accept | ||
| 39 | will also return when the underlying | ||
| 40 | .Vt BIO | ||
| 41 | could not satisfy the needs of | ||
| 42 | .Fn SSL_accept | ||
| 43 | to continue the handshake, indicating the problem by the return value \(mi1. | ||
| 44 | In this case a call to | ||
| 45 | .Xr SSL_get_error 3 | ||
| 46 | with the | ||
| 47 | return value of | ||
| 48 | .Fn SSL_accept | ||
| 49 | will yield | ||
| 50 | .Dv SSL_ERROR_WANT_READ | ||
| 51 | or | ||
| 52 | .Dv SSL_ERROR_WANT_WRITE . | ||
| 53 | The calling process then must repeat the call after taking appropriate action | ||
| 54 | to satisfy the needs of | ||
| 55 | .Fn SSL_accept . | ||
| 56 | The action depends on the underlying | ||
| 57 | .Dv BIO . | ||
| 58 | When using a non-blocking socket, nothing is to be done, but | ||
| 59 | .Xr select 2 | ||
| 60 | can be used to check for the required condition. | ||
| 61 | When using a buffering | ||
| 62 | .Vt BIO , | ||
| 63 | like a | ||
| 64 | .Vt BIO | ||
| 65 | pair, data must be written into or retrieved out of the | ||
| 66 | .Vt BIO | ||
| 67 | before being able to continue. | ||
| 68 | .Sh RETURN VALUES | ||
| 69 | The following return values can occur: | ||
| 70 | .Bl -tag -width Ds | ||
| 71 | .It 0 | ||
| 72 | The TLS/SSL handshake was not successful but was shut down controlled and by | ||
| 73 | the specifications of the TLS/SSL protocol. | ||
| 74 | Call | ||
| 75 | .Xr SSL_get_error 3 | ||
| 76 | with the return value | ||
| 77 | .Fa ret | ||
| 78 | to find out the reason. | ||
| 79 | .It 1 | ||
| 80 | The TLS/SSL handshake was successfully completed, | ||
| 81 | and a TLS/SSL connection has been established. | ||
| 82 | .It <0 | ||
| 83 | The TLS/SSL handshake was not successful because a fatal error occurred either | ||
| 84 | at the protocol level or a connection failure occurred. | ||
| 85 | The shutdown was not clean. | ||
| 86 | It can also occur of action is need to continue the operation for non-blocking | ||
| 87 | .Vt BIO Ns | ||
| 88 | s. | ||
| 89 | Call | ||
| 90 | .Xr SSL_get_error 3 | ||
| 91 | with the return value | ||
| 92 | .Fa ret | ||
| 93 | to find out the reason. | ||
| 94 | .El | ||
| 95 | .Sh SEE ALSO | ||
| 96 | .Xr bio 3 , | ||
| 97 | .Xr ssl 3 , | ||
| 98 | .Xr SSL_connect 3 , | ||
| 99 | .Xr SSL_CTX_new 3 , | ||
| 100 | .Xr SSL_do_handshake 3 , | ||
| 101 | .Xr SSL_get_error 3 , | ||
| 102 | .Xr SSL_set_connect_state 3 , | ||
| 103 | .Xr SSL_shutdown 3 | ||
