Permalink
Browse files

Merge pull request #64 from nsabovic/master

Add rejectUnauthorized as an option.
  • Loading branch information...
2 parents 613fbda + 2dd8215 commit faebb57cf276e20287914ae1e777bd4d4bac423a @argon argon committed Sep 24, 2012
Showing with 2 additions and 5 deletions.
  1. +2 −5 lib/connection.js
View
@@ -42,6 +42,7 @@ function Connection (options) {
ca: null,
gateway: 'gateway.push.apple.com',
port: 2195,
+ rejectUnauthorized: true,
enhanced: true,
errorCallback: undefined,
cacheLength: 100
@@ -133,17 +134,13 @@ Connection.prototype.connect = function () {
socketOptions.cert = this.certData;
socketOptions.passphrase = this.options.passphrase;
socketOptions.ca = this.options.ca;
+ socketOptions.rejectUnauthorized = this.options.rejectUnauthorized;
this.socket = tls.connect(
this.options['port'],
this.options['gateway'],
socketOptions,
function () {
- if (!this.socket.authorized) {
- this.deferredConnection.reject(this.socket.authorizationError);
- return;
- }
-
if (this.connectionTimeout) {
clearTimeout(this.connectionTimeout);
}

0 comments on commit faebb57

Please sign in to comment.