diff --git a/xtrn/mrc/mrc-connector.js b/xtrn/mrc/mrc-connector.js index 0c4001c2442a2abd43c3745db7ddde56eef5d076..7d139873688fc899d87431afdc098c02097bea7c 100644 --- a/xtrn/mrc/mrc-connector.js +++ b/xtrn/mrc/mrc-connector.js @@ -25,6 +25,9 @@ const system_info = f.iniGetObject('info') || {}; f.close(); f = undefined; +if (!settings.ssl) + settings.ssl=false; + const PROTOCOL_VERSION = '1.3.0'; const MAX_LINE = 256; const FROM_SITE = system.qwk_id.toLowerCase(); @@ -152,13 +155,21 @@ function client_send(message, username) { }); } -function mrc_connect(host, port) { +function mrc_connect(host, port, ssl) { if (time() - last_connect < settings.reconnect_delay) return false; last_connect = time(); const sock = new Socket(); sock.nonblocking = true; log(LOG_INFO, 'Connecting to ' + host + ':' + port); if (!sock.connect(host, port, settings.timeout)) return false; + if (ssl) + sock.ssl_session=true; + + if (ssl && port !== 5001) + log(LOG_INFO, "If SSL is true then you probably want port 5001"); + if (!ssl && port !== 5000) + log(LOG_INFO, "Your probably want port 5000 if not using SSL"); + const platform = format( 'SYNCHRONET/%s_%s/%s', system.platform, system.architecture, PROTOCOL_VERSION @@ -242,7 +253,7 @@ function main() { yield(); if (!mrc_sock || !mrc_sock.is_connected) { - mrc_sock = mrc_connect(settings.server, settings.port); + mrc_sock = mrc_connect(settings.server, settings.port, settings.ssl); continue; } mswait(10); diff --git a/xtrn/mrc/readme.txt b/xtrn/mrc/readme.txt index 93b96b8393233b8e0af81d1636732f08b25bbd1e..63148b8be660201873ce05428afd1903afb5dbc9 100644 --- a/xtrn/mrc/readme.txt +++ b/xtrn/mrc/readme.txt @@ -4,7 +4,9 @@ echicken -at- bbs.electronicchicken.com 1) Quick Start 2) Client -> Server -> Server 3) Customization -4) Support +4) SSL Support +5) Customization +6) Support 1) Quick Start @@ -96,7 +98,22 @@ rename it "chat_sec.js", in order to add M as a valid menu option for Multi-Relay Chat. -4) Support +5) SSL Support +If you would like connections between your server and the MRC server to be +secure, you can enable SSL as follows: + + edit mrc-connector.ini and make these changes in the upper global section: + + change port from 5000 to 5001 + add ssl=true + +Then recycle services with touch /sbbs/ctrl/services.recycle or use your windows +control panel. Client to local server connections are not yet encrypted but that +shouldn't be difficult. Once connected to MRC you can type /BBSES and you should +see "Yes" next to your BBS in the SSL column. + + +6) Support - Post a message to 'echicken' in the Synchronet Sysops area on DOVE-Net - Find me on irc.synchro.net in #synchronet