Configure IRC Server SSL handling
authorJack Allnutt <m2ys4u@Gmail.com>
Wed, 31 Oct 2012 12:08:50 +0000 (12:08 +0000)
committerJack Allnutt <m2ys4u@Gmail.com>
Wed, 31 Oct 2012 12:08:50 +0000 (12:08 +0000)
Can now configure whether or not to accept an IRC server's SSL certificate if it's not got a cert chain to a well-known CA

config.js
server/irc/connection.js

index 57aaf6c6081da9d147f7e800c713f7800d7a8865..946bd26d3e5672580d60a0724957df109ace1903 100644 (file)
--- a/config.js
+++ b/config.js
@@ -62,7 +62,8 @@ conf.ip_as_username = [
        "127.0.0.1"
 ];
 
-
+// Whether to verify IRC servers' SSL certificates against built-in well-known certificate authorities
+conf.reject_unauthorised_certificates = false;
 
 
 // Whitelisted HTTP proxies
index cb4b4f2dd9e17153a0839cd2ab530698877685f3..3d7c7ca35d82414fdf16870ce6305b50c29c685d 100644 (file)
@@ -10,7 +10,7 @@ var IrcConnection = function (hostname, port, ssl, nick, user, pass) {
     events.EventEmitter.call(this);
     
     if (ssl) {
-        this.socket = tls.connect(port, hostname, {}, connect_handler);
+        this.socket = tls.connect({host: hostname, port: port, rejectUnauthorized: global.config.reject_unauthorised_certificates}, connect_handler);
     } else {
         this.socket = net.createConnection(port, hostname);
         this.socket.on('connect', function () {