From 6072304ff1d1c90c90151a662334c5c13481e809 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Thu, 18 Nov 2010 13:18:42 +0100 Subject: [PATCH] fippo redo: make tls available on default psyc port (in addition to psycs port) --- world/drivers/ldmud/master/accept.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/world/drivers/ldmud/master/accept.c b/world/drivers/ldmud/master/accept.c index 523881c..4ae43ed 100644 --- a/world/drivers/ldmud/master/accept.c +++ b/world/drivers/ldmud/master/accept.c @@ -70,19 +70,22 @@ object connect(int uid, int port, string service) { // we dont want the telnet machine most of the time // but disabling and re-enabling it for telnet doesn't work switch(port || query_mud_port()) { - -#if HAS_PORT(PSYCS_PORT, PSYC_PATH) - case PSYCS_PORT: // inofficial & temporary -# if __EFUN_DEFINED__(tls_want_peer_certificate) - tls_want_peer_certificate(ME); -# endif - t = tls_init_connection(this_object()); - if (t < 0 && t != ERR_TLS_NOT_DETECTED) PP(( "TLS on %O: %O\n", - query_mud_port(), tls_error(t) )); -#endif // fall thru #if HAS_PORT(PSYC_PORT, PSYC_PATH) case PSYC_PORT: #endif +#if HAS_PORT(PSYCS_PORT, PSYC_PATH) + case PSYCS_PORT: // inofficial & temporary + // make TLS available even on the default psyc port using the autodetection feature + if (tls_available()) { +# if __EFUN_DEFINED__(tls_want_peer_certificate) + tls_want_peer_certificate(ME); +# endif + t = tls_init_connection(this_object()); + if (t < 0 && t != ERR_TLS_NOT_DETECTED) { + PP(( "TLS on %O: %O\n", query_mud_port(), tls_error(t) )); + } + } +#endif // fall thru #if HAS_PORT(PSYC_PORT, PSYC_PATH) || HAS_PORT(PSYCS_PORT, PSYC_PATH) # ifdef DRIVER_HAS_CALL_BY_REFERENCE arg = ME;