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