Skip to content

Commit cb6b2cf

Browse files
Andrew LeeAndrew Lee
authored andcommitted
Added self-signed cert option
1 parent fa42d4e commit cb6b2cf

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ There are many users and networks who are stably using it today!
1414
- No registration or account required
1515
- Separate buffers for clients
1616
- SSL
17+
- SASL
1718
- Works with any RFC 1459 Compatible Client
1819
- Password can be changed in the config and a HUP will reload the passwords.
1920
- ***Gateway Mode for IRC Servers and Networks (See Below)***
@@ -101,12 +102,19 @@ Optional: you can put the account at the end for SASL identification, ideal if t
101102
dragon||AJFiej2fn2345/irc.dal.net:6667/mobile/ArMyN
102103
```
103104

105+
Your connection password gets used to attempt SASL identification.
106+
104107
#### SSL Client
105108
Use "+port" to do SSL. For example:
106109
```
107110
dragon||Ajdfklsjfa/irc.dal.net:+6697/mobile
108111
```
109112

113+
You can also use "=port" to do SSL with a self-signed cert.
114+
```
115+
dragon||Ajdfklsjfa/irc.dal.net:=6697/mobile
116+
```
117+
110118
#### Whilst Connected
111119
To get a list of commands:
112120
```

bouncer.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,12 +719,26 @@ function clientConnect(socket) {
719719
let _success=true;
720720
let _connector=net.createConnection;
721721
let _tempport=socket.irc.port.toString();
722+
let _ssl=false;
723+
let _options = {
724+
rejectUnauthorized: true
725+
};
722726
if(_tempport.substr(0,1)=="+") {
723727
_connector=tls.connect;
724728
_tempport=parseInt(socket.irc.port.toString().substr(1));
729+
_ssl=true;
730+
}
731+
else if(_tempport.substr(0,1)=="=") {
732+
_connector=tls.connect;
733+
_tempport=parseInt(socket.irc.port.toString().substr(1));
734+
_ssl=true;
735+
_options = { rejectUnauthorized: false };
725736
}
726737
try {
727-
connection = _connector(_tempport, socket.irc.server);
738+
if(_ssl)
739+
connection = _connector(_tempport, socket.irc.server, _options);
740+
else
741+
connection = _connector(_tempport, socket.irc.server);
728742
} catch(e) {
729743
if(DEBUG) {
730744
console.log("Failed to connect to "+socket.irc.server+ ":"+__tempport);

0 commit comments

Comments
 (0)