ekmartin / slack-irc

Connects Slack and IRC channels by sending messages back and forth.
MIT License
588 stars 157 forks source link

SASL+SSL support? #38

Closed filler closed 9 years ago

filler commented 9 years ago

Hello --

First off thanks for this awesome code. Its helpful and Im glad to see it curated. :+1: :smile:

I was wondering if SASL support works as intended. As best as I can tell, Im striking out using SASL combined with SSL. The README links to http://node-irc.readthedocs.org/en/latest/API.html#irc.Client, but using what I think are relevant ircOptions dont seem to work.

[
  {
    "nickname": "botnick",
    "server": "irc.company.corp",
    "token": "slacktoken",
    "channelMapping": {
      "#slackchan": "#ircchan"
    },
    "ircOptions": {
      "floodProtection": false,
      "floodProtectionDelay": 1000,
      "userName": "botnick",
      "port": 6697,
      "sasl": true,
      "secure": true,
      "selfSigned": true,
      "certExpired": true,
      "debug": true,
      "nick": "botnick",
      "userName": "botnick",
      "password": "pass"
    }
  }
]
$ node index.js
[Wed Jun 03 2015 00:37:22 GMT+0000 (UTC)] INFO Connecting...
3 Jun 00:37:22 - SEND: PASS pass
3 Jun 00:37:22 - Sending irc NICK/USER
3 Jun 00:37:22 - SEND: NICK botnick
3 Jun 00:37:22 - SEND: USER botnick 8 * botnick
3 Jun 00:37:24 - Unhandled message: { command: 'ERROR',
  rawCommand: 'ERROR',
  commandType: 'normal',
  args: [ 'Closing link: (~botnick@104.239.146.51) [Access denied by configuration]' ] }
3 Jun 00:37:24 - Connection got "close" event
3 Jun 00:37:24 - Disconnected: reconnecting
3 Jun 00:37:24 - Waiting 2000ms before retrying
3 Jun 00:37:24 - Connection got "end" event

Curious. Thanks so much!

filler commented 9 years ago

Going to close this as Ive got it working on freenode. Must be my corp IRC server. :tired_face:

[
  {
    "nickname": "botnick",
    "server": "irc.freenode.net",
    "token": "slacktoken",
    "channelMapping": {
      "#slackchan": "#ircchan"
    },
    "ircOptions": {
      "floodProtection": false,
      "floodProtectionDelay": 1000,
      "port": 6697,
      "sasl": true,
      "secure": true,
      "selfSigned": true,
      "certExpired": true,
      "debug": true,
      "nick": "botnick",
      "userName": "botnick",
      "password": "pass"
    }
  }
]
$ node index.js
[Wed Jun 03 2015 02:24:26 GMT+0000 (UTC)] INFO Connecting...
3 Jun 02:24:27 - SEND: PASS pass
3 Jun 02:24:27 - Sending irc NICK/USER
3 Jun 02:24:27 - SEND: NICK botnick
3 Jun 02:24:27 - SEND: USER botnick 8 * botnick
3 Jun 02:24:27 - Unhandled message: { prefix: 'wolfe.freenode.net',
  server: 'wolfe.freenode.net',
  command: 'rpl_luserunknown',
  rawCommand: '253',
  commandType: 'reply',
  args: [ 'botnick', '9', 'unknown connection(s)' ] }
3 Jun 02:24:27 - SEND: JOIN #ircchan
3 Jun 02:24:27 - MODE: botnick sets mode: +Zi
3 Jun 02:24:27 - GOT NOTICE from "NickServ": "This nickname is registered. Please choose a different nickname, or identify via /msg NickServ identify <password>."
3 Jun 02:24:27 - GOT NOTICE from "NickServ": "You are now identified for botnick."
3 Jun 02:24:33 - SEND: MODE #ircchan
ekmartin commented 9 years ago

Can you connect to your IRC server with SASL + SSL using an IRC client? Thank you for the kind feedback nonetheless.

filler commented 9 years ago

I sure can. In weechat v1.2:

/server add corp irc.company.corp/6697 -ssl -nossl_verify -ssl_dhkey_size=1024 \
-sasl_mechanism=plain -sasl_username=botnick -sasl_password=pass
ekmartin commented 9 years ago

Sorry for the extremely late answer, but if you're still interested in getting it to work I'd suggest making an issue over at node-irc, as slack-irc just forwards the settings directly.

filler commented 7 years ago

Hello! Sorry to bump an old thread, but the following code in an amazing colleague'S topic branch: git://github.com/martinb3/node-irc.git#0.3.x

Pointing there in config.json let me do the corporate needful!

Happy Slacking!