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