1gnutls_handshake(3) gnutls gnutls_handshake(3)
2
3
4
6 gnutls_handshake - This is the main function in the handshake protocol.
7
9 #include <gnutls/gnutls.h>
10
11 int gnutls_handshake(gnutls_session_t session);
12
14 gnutls_session_t session
15 is a gnutls_session_t structure.
16
18 This function does the handshake of the TLS/SSL protocol, and initial‐
19 izes the TLS connection.
20
21 This function will fail if any problem is encountered, and will return
22 a negative error code. In case of a client, if the client has asked to
23 resume a session, but the server couldn't, then a full handshake will
24 be performed.
25
26 The non-fatal errors such as GNUTLS_E_AGAIN and GNUTLS_E_INTERRUPTED
27 interrupt the handshake procedure, which should be later be resumed.
28 Call this function again, until it returns 0; cf.
29 gnutls_record_get_direction() and gnutls_error_is_fatal().
30
31 If this function is called by a server after a rehandshake request then
32 GNUTLS_E_GOT_APPLICATION_DATA or GNUTLS_E_WARNING_ALERT_RECEIVED may be
33 returned. Note that these are non fatal errors, only in the specific
34 case of a rehandshake. Their meaning is that the client rejected the
35 rehandshake request.
36
38 GNUTLS_E_SUCCESS on success, otherwise an error.
39
41 Report bugs to <bug-gnutls@gnu.org>. GnuTLS home page:
42 http://www.gnu.org/software/gnutls/ General help using GNU software:
43 http://www.gnu.org/gethelp/
44
46 Copyright © 2008 Free Software Foundation.
47 Copying and distribution of this file, with or without modification,
48 are permitted in any medium without royalty provided the copyright
49 notice and this notice are preserved.
50
52 The full documentation for gnutls is maintained as a Texinfo manual.
53 If the info and gnutls programs are properly installed at your site,
54 the command
55
56 info gnutls
57
58 should give you access to the complete manual.
59
60
61
62gnutls 2.8.6 gnutls_handshake(3)