MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 1 | PRELIMINARY |
| 2 | CONCEPT |
| 3 | tls (transport layer security) |
| 4 | |
| 5 | DESCRIPTION |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame] | 6 | 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 17 | |
| 18 | USAGE |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame] | 19 | 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 23 | |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame] | 24 | You can switch on TLS by calling tls_init_connection(). |
| 25 | This can happen in three ways: |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 26 | |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame] | 27 | 1) in telnet_neg() |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 28 | |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame] | 29 | 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 32 | the client with help of telnet option STARTTLS. Currently |
| 33 | there are no mudclients that support this method. |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame] | 34 | |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 35 | 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 | |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame] | 41 | 2) in master_ob->connect() |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 42 | |
| 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. |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame] | 47 | |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 48 | 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 |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame] | 54 | telnet: it is useful for implementing protocols that use |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 55 | 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 | |
| 68 | BUG |
| 69 | This manpage might be not quite up to date with the implementation. |
| 70 | |
| 71 | HISTORY |
| 72 | Introduced in LDMud 3.3.474 and following, backported to 3.2.11. |
| 73 | |
| 74 | SEE ALSO |
| 75 | tls_* efuns |