blob: d42d8de4747116dff8dd6afa41a32c35483c3596 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001PRELIMINARY
2CONCEPT
3 tls (transport layer security)
4
5DESCRIPTION
Zesstra7ea4a032019-11-26 20:11:40 +01006 TLS stands for Transport Layer Security which is the successor
7 of the well known SSL (Secure Socket Layer). Both techniques
8 provide a way to authenticate and encrypt the data send through
9 a network connection.
10
11 By enabling TLS during compilation of the driver you can provide
12 a secure channel into the mud to your players.
13
14 In difference to other solutions as "sslwrap" or "stunnel" the
15 driver integrated approach has the advantage that the mud sees
16 the real IP of the player, not the IP of the local mud host.
MG Mud User88f12472016-06-24 23:31:02 +020017
18USAGE
Zesstra7ea4a032019-11-26 20:11:40 +010019 To use TLS configure your driver with --enable-tls option.
20 After starting your driver you have five new efuns
21 (tls_init_connection(), tls_deinit_connection(), tls_error(),
22 tls_query_connection_info(), tls_query_connection_state()).
MG Mud User88f12472016-06-24 23:31:02 +020023
Zesstra7ea4a032019-11-26 20:11:40 +010024 You can switch on TLS by calling tls_init_connection().
25 This can happen in three ways:
MG Mud User88f12472016-06-24 23:31:02 +020026
Zesstra7ea4a032019-11-26 20:11:40 +010027 1) in telnet_neg()
MG Mud User88f12472016-06-24 23:31:02 +020028
Zesstra7ea4a032019-11-26 20:11:40 +010029 Advantage of this method is that you can offer TLS on a normal
30 mud port. If you have a limited number of ports this can
31 become important. The TLS connection will be started by
MG Mud User88f12472016-06-24 23:31:02 +020032 the client with help of telnet option STARTTLS. Currently
33 there are no mudclients that support this method.
Zesstra7ea4a032019-11-26 20:11:40 +010034
MG Mud User88f12472016-06-24 23:31:02 +020035 You will have to implement the telnet option STARTTLS (46) for
36 this method. The draft for this can be found here:
37 http://www.ietf.org/proceedings/99mar/I-D/draft-ietf-tn3270e-telnet-tls-01.txt
38 Call tls_init_connection() to initiate the TLS handshake.
39
40
Zesstra7ea4a032019-11-26 20:11:40 +010041 2) in master_ob->connect()
MG Mud User88f12472016-06-24 23:31:02 +020042
43 Advantage of this method is that your users can connect with
44 any program that supports TLS/SSL. Examples are telnet-ssl,
45 sslwrap or stunnel. Disadvantage is that you have to spend
46 a dedicated port for this.
Zesstra7ea4a032019-11-26 20:11:40 +010047
MG Mud User88f12472016-06-24 23:31:02 +020048 You have to call tls_init_connection() as first command
49 after the player connected (normally in master_ob->connect())
50
51 3) in an interactive object using a callback.
52
53 This method is similar to method (1), but not limited to
Zesstra7ea4a032019-11-26 20:11:40 +010054 telnet: it is useful for implementing protocols that use
MG Mud User88f12472016-06-24 23:31:02 +020055 STARTTLS like SMTP or IMAP. tls_init_connection() can be
56 called at any time by the interactive object.
57
58 You must not write to the connection after calling this
59 efun until the callback is executed (the prompt will
60 be supressed automatically during this time).
61
62 To test your code, you can use the openssl binary.
63 `openssl s_client -connect host:port' should display your certificate
64 and anything you write after the callback is executed. If you
65 encounter the error message `SSL3_GET_RECORD: wrong version number'
66 you're probably writing to the connection while you should not.
67
68BUG
69 This manpage might be not quite up to date with the implementation.
70
71HISTORY
72 Introduced in LDMud 3.3.474 and following, backported to 3.2.11.
73
74SEE ALSO
75 tls_* efuns