Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect to SSL server #76

Closed
domkm opened this issue Apr 9, 2013 · 8 comments
Closed

Cannot connect to SSL server #76

domkm opened this issue Apr 9, 2013 · 8 comments

Comments

@domkm
Copy link

domkm commented Apr 9, 2013

I have been unable to get hubot-irc to connect to a SSL IRC server. This includes both my company's SSL IRC server as well as Grove's SSL IRC server.

Configuration (with a few redactions)
HUBOT_IRC_NICK="botname"
HUBOT_IRC_REALNAME="bot real name"
HUBOT_IRC_PORT=6697
HUBOT_IRC_ROOMS="#ircroom"
HUBOT_IRC_SERVER="irc.example.com"
HUBOT_IRC_PASSWORD="password"
HUBOT_IRC_DEBUG="true"
HUBOT_IRC_USESSL="true"
HUBOT_IRC_USERNAME="botname"
HUBOT_IRC_SERVER_FAKE_SSL="true" # removing this changes nothing
HUBOT_IRC_SERVER_CERT_EXPIRED="true" # removing this changes nothing

Despite HUBOT_IRC_DEBUG="true", this is the output:

Connection got "close" event
Disconnected: reconnecting
Waiting 2000ms before retrying
Connection got "end" event

These four lines repeat indefinitely. I don't find this particularly helpful for debugging.

I have also replicated this with @jgable's hubot-irc-runnable. The same thing happens regardless of whether the bot is hosted on Heroku or being run locally. Also note that I have been able to get both hubot-irc and hubot-irc-runnable to connect to multiple non-SSL IRC servers.

I think I must be missing something but I haven't been able to figure it out. I would greatly appreciate any assistance.

@jgable
Copy link
Collaborator

jgable commented Apr 9, 2013

That's interesting. It works for my company private irc server that is using ssl. Here is my settings:

# Set Environment Variables
export HUBOT_IRC_NICK=b3nder
export HUBOT_IRC_SERVER=1.2.3.4
export HUBOT_IRC_ROOMS="#benders_lair"
export HUBOT_IRC_PORT=6697
export HUBOT_IRC_USESSL=true
export HUBOT_IRC_SERVER_FAKE_SSL=true
export HUBOT_IRC_PASSWORD=somepass
export HUBOT_IRC_UNFLOOD=true

Those errors are coming from the node-irc module, If you want more debugging infomation, check there or go into your node_modules/hubot-irc/node_modules/irc/lib/irc.js file and start throwing console.log around.

@domkm
Copy link
Author

domkm commented Apr 10, 2013

Thanks, @jgable. This issue appears to be caused by node-irc's incompatibility with Node 0.10.x (martynsmith/node-irc#160).

@kingcody
Copy link
Contributor

Hey there, i've been plagued by this issue for quite some time now. However there is a fix for the issue as prescribed in the comments. I've forked node-irc and applied the patch. In my irc-adapter I use my fork as the irc dependency.

git://github.com/kingcody/node-irc.git
like so:
torp@93642e6

If anyone else would like to use it please feel free to pull from it. I've tested this with node 0.10.5 and all is working.

Not sure if the Maintainer is very active on the repo; Being as the issue has been unresolved for some time now...
Also if anyone else is interested in the fix, here is the commit:
kingcody/node-irc@09bcfd8

@nandub nandub closed this as completed in 4d10cfa Jun 30, 2013
@nandub
Copy link
Owner

nandub commented Jun 30, 2013

@jgable and @kingcody in the meantime I created a local node-irc fork to fix this problem and pointed the package.json file to point to the fork.

@kingcody
Copy link
Contributor

Awesome, thanks @nandub.
This should help a bunch of folks.

@nandub
Copy link
Owner

nandub commented Jun 30, 2013

I haven't publish yet. I want to wait for @jgable to review it.

@kingcody
Copy link
Contributor

I gotcha @nandub.

Also, @jgable as per your earlier comment on this subject; this issue is specific to self signed & expired certs.
I'm guessing your company uses root level signed certs so you most likely would not encounter the bug, as the self signed would not be triggered. Or perhaps an earlier version of node, as I tracked this bug down to an early 0.9.?(can't remember) release. So any 0.8.x won't be affected.

Also the actual change is how node's crypto methods work. They received some decent changes in 0.9.x that resulted in the node-irc ssl bug.

@jgable
Copy link
Collaborator

jgable commented Jul 1, 2013

Everything looks good. I'm on 0.8.12 and everything you say about the self signed certs sounds probable for our company server.

Is there a readme update for this new option?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants