blob: e36bbac717b8b7379f0df71117ab2388392aeb1c [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001PRELIMINARY
2SYNOPSIS
3 int tls_init_connection(object ob)
Zesstra715ec202025-07-09 22:18:31 +02004 int tls_init_connection(object ob, string fun, string|object fob,
5 mixed extra...)
MG Mud User88f12472016-06-24 23:31:02 +02006 int tls_init_connection(object ob, closure fun, mixed extra...)
7
8DESCRIPTION
9 tls_init_connection() tries to start a TLS secured connection to
10 the interactive object <ob> (or this_object() if <ob> is not given).
11
12 Result:
13 errorcode < 0: unsuccessful, use tls_error() to get an useful
14 description of the error
15 number > 0: the secure connection is still being set up in the
16 background
17 number == 0: the secure connection is active.
18
19 OpenSSL only:
20
21 If the callback <fun>/<fun>:<fob> is specified, it will be called
22 once the fate of the secure connection has been determined. The
23 first argument will be the return code from the handshake
24 (errorcode < 0 on failure, or 0 on success), followed by the
25 interactive object <ob> and any <extra> arguments.
26
27 If the TLS setup fails, it is not necessary to call
28 tls_deinit_connection().
29
30 IMPORTANT: During the TLS handshake nothing else must be sent
31 to the client! For the most cases (TLS-capable clients logging in)
32 this means that the TLS handshake is the first and only thing the
33 client gets to see while the handshake is in progress.
34
35 The driver automatically suppresses the printing of the prompt
36 while the TLS handshake is in progress.
37
38 If tls_init_connection() is called in the master::connect() function,
39 the driver will either call the set callback in place of logon(), or
40 if not callback has been set, delay the call of logon() until the
41 state of the connection is clear.
42
43HISTORY
44 Introduced in LDMud 3.3.474 and following, backported to 3.2.11.
45 LDMud 3.2.13/3.3.713 streamlined the handling of secure connections
46 during logon.
47
48SEE ALSO
49 tls_deinit_connection(E), tls_error(E), tls_query_connection_state(E),
50 tls_query_connection_info(E), tls_available(E),
51 tls_check_certificate(E), tls_refresh_certs(E), connect(M), logon(A)