fippo redo: make tls available on default psyc port (in addition to psycs port)

This commit is contained in:
psyc://psyced.org/~lynX 2010-11-18 13:18:42 +01:00
parent 6fcc4c7225
commit 6072304ff1

View File

@ -70,19 +70,22 @@ object connect(int uid, int port, string service) {
// we dont want the telnet machine most of the time // we dont want the telnet machine most of the time
// but disabling and re-enabling it for telnet doesn't work // but disabling and re-enabling it for telnet doesn't work
switch(port || query_mud_port()) { switch(port || query_mud_port()) {
#if HAS_PORT(PSYC_PORT, PSYC_PATH)
case PSYC_PORT:
#endif
#if HAS_PORT(PSYCS_PORT, PSYC_PATH) #if HAS_PORT(PSYCS_PORT, PSYC_PATH)
case PSYCS_PORT: // inofficial & temporary 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) # if __EFUN_DEFINED__(tls_want_peer_certificate)
tls_want_peer_certificate(ME); tls_want_peer_certificate(ME);
# endif # endif
t = tls_init_connection(this_object()); t = tls_init_connection(this_object());
if (t < 0 && t != ERR_TLS_NOT_DETECTED) PP(( "TLS on %O: %O\n", if (t < 0 && t != ERR_TLS_NOT_DETECTED) {
query_mud_port(), tls_error(t) )); PP(( "TLS on %O: %O\n", query_mud_port(), tls_error(t) ));
}
}
#endif // fall thru #endif // fall thru
#if HAS_PORT(PSYC_PORT, PSYC_PATH)
case PSYC_PORT:
#endif
#if HAS_PORT(PSYC_PORT, PSYC_PATH) || HAS_PORT(PSYCS_PORT, PSYC_PATH) #if HAS_PORT(PSYC_PORT, PSYC_PATH) || HAS_PORT(PSYCS_PORT, PSYC_PATH)
# ifdef DRIVER_HAS_CALL_BY_REFERENCE # ifdef DRIVER_HAS_CALL_BY_REFERENCE
arg = ME; arg = ME;