summaryrefslogtreecommitdiff
path: root/src/lib/libssl/doc/SSL_do_handshake.3
diff options
context:
space:
mode:
authorbentley <>2014-10-12 09:33:04 +0000
committerbentley <>2014-10-12 09:33:04 +0000
commit82b7f378b6907ab315a6e50322d2a0a8794a0aa9 (patch)
treea5087bf8d016a6041c2b6822fbecfd8f6c5e70b1 /src/lib/libssl/doc/SSL_do_handshake.3
parent0a63f0cf49369e1926567ab62e04e3355cedf0cd (diff)
downloadopenbsd-82b7f378b6907ab315a6e50322d2a0a8794a0aa9.tar.gz
openbsd-82b7f378b6907ab315a6e50322d2a0a8794a0aa9.tar.bz2
openbsd-82b7f378b6907ab315a6e50322d2a0a8794a0aa9.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.3110
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
13will wait for a SSL/TLS handshake to take place.
14If the connection is in client mode, the handshake will be started.
15The handshake routines may have to be explicitly set in advance using either
16.Xr SSL_set_connect_state 3
17or
18.Xr SSL_set_accept_state 3 .
19.Sh NOTES
20The behaviour of
21.Fn SSL_do_handshake
22depends on the underlying
23.Vt BIO .
24.Pp
25If the underlying
26.Vt BIO
27is
28.Em blocking ,
29.Fn SSL_do_handshake
30will only return once the handshake has been finished or an error occurred,
31except for SGC (Server Gated Cryptography).
32For SGC,
33.Fn SSL_do_handshake
34may return with \(mi1, but
35.Xr SSL_get_error 3
36will yield
37.Dv SSL_ERROR_WANT_READ
38or
39.Dv SSL_ERROR_WANT_WRITE
40and
41.Fn SSL_do_handshake
42should be called again.
43.Pp
44If the underlying
45.Vt BIO
46is
47.Em non-blocking ,
48.Fn SSL_do_handshake
49will also return when the underlying
50.Vt BIO
51could not satisfy the needs of
52.Fn SSL_do_handshake
53to continue the handshake.
54In this case a call to
55.Xr SSL_get_error 3
56with the return value of
57.Fn SSL_do_handshake
58will yield
59.Dv SSL_ERROR_WANT_READ
60or
61.Dv SSL_ERROR_WANT_WRITE .
62The calling process then must repeat the call after taking appropriate action
63to satisfy the needs of
64.Fn SSL_do_handshake .
65The action depends on the underlying
66.Vt BIO .
67When using a non-blocking socket, nothing is to be done, but
68.Xr select 2
69can be used to check for the required condition.
70When using a buffering
71.Vt BIO ,
72like a
73.Vt BIO
74pair, data must be written into or retrieved out of the
75.Vt BIO
76before being able to continue.
77.Sh RETURN VALUES
78The following return values can occur:
79.Bl -tag -width Ds
80.It 0
81The TLS/SSL handshake was not successful but was shut down controlled and
82by the specifications of the TLS/SSL protocol.
83Call
84.Xr SSL_get_error 3
85with the return value
86.Fa ret
87to find out the reason.
88.It 1
89The TLS/SSL handshake was successfully completed,
90and a TLS/SSL connection has been established.
91.It <0
92The TLS/SSL handshake was not successful because either a fatal error occurred
93at the protocol level or a connection failure occurred.
94The shutdown was not clean.
95It can also occur if action is needed to continue the operation for
96non-blocking
97.Vt BIO Ns s.
98Call
99.Xr SSL_get_error 3
100with the return value
101.Fa ret
102to 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