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
1 changed files with 13 additions and 10 deletions

View File

@ -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;