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