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

enable ssl connections through IRC-js api #69

Merged
4 commits merged into from May 12, 2014

Conversation

aaronj1335
Copy link
Collaborator

depends on #68

this allows the user to include an ssl hash (or bool) in the server
connection params:

var irc = require('irc-js');
var bot = irc.connect({
  server: {
    address: 'chat.freenode.net',
    port: 6697,
    ssl: true // could also be: {rejectUnauthorized: false}
  },
  nick: 'aaronj1335'
}, function(bot) {
  // ...
});

the value defaults to false, and if it's truthy, it gets passed strait
through to tls.connect.

a couple thoughts:

  • i didn't include a unit test only because i don't know what exactly to
    test, though i'm happy to implement something
  • this messes with the server caching. cases where the user wants two
    connections, one ssl and one not ssl to the same server/port will be
    handled incorrectly. i think these are rare enough that it's safe to
    ignore for now though.

the callback to `Channel#join` doesn't receive the new channel object as
the first argument. this was causing tests to fail. i tweaked the tests
to just use the return value of `join` instead of the parameter in the
interest of just getting the tests to pass.

ideally i would fix the argument, but that was a bit more involved, and
i just want to debug the network error problem.
this allows the user to include an `ssl` hash (or bool) in the server
connection params:

```js
var irc = require('irc-js');
var bot = irc.connect({
  server: {
    address: 'chat.freenode.net',
    port: 6697,
    ssl: true // could also be: {rejectUnauthorized: false}
  },
  nick: 'aaronj1335'
}, function(bot) {
  // ...
});
```

the value defaults to false, and if it's truthy, it gets passed strait
through to [`tls.connect`][tls-connect].

a couple thoughts:

- i didn't include a unit test only because i don't know what exactly to
test, though i'm happy to implement something

- this messes with the server caching. cases where the user wants two
connections, one ssl and one not ssl to the same server/port will be
handled incorrectly. i think these are rare enough that it's safe to
ignore for now though.

[tls-connect]: http://nodejs.org/api/tls.html
ghost pushed a commit that referenced this pull request May 12, 2014
enable ssl connections through IRC-js api
@ghost ghost merged commit c1ade51 into gf3:master May 12, 2014
@aaronj1335 aaronj1335 deleted the enable-ssl-support branch May 12, 2014 19:55
This pull request was closed.
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

Successfully merging this pull request may close these issues.

None yet

1 participant