Skip to content
This repository
Browse code

Merge pull request #66 from 4mo1/master

feedback service via proxy also requires rejectUnauthorized flag
  • Loading branch information...
commit 1ec14c8fe3d4e17c475392cc90f5d659e4380c23 2 parents 1fc5255 + 6b3daa1
Andrew Naylor authored October 04, 2012

Showing 1 changed file with 2 additions and 5 deletions. Show diff stats Hide diff stats

  1. 7  lib/feedback.js
7  lib/feedback.js
@@ -42,6 +42,7 @@ function Feedback(options) {
42 42
 		ca: null,							/* Certificate Authority
43 43
 		address: 'feedback.push.apple.com',	/* feedback address */
44 44
 		port: 2196,							/* feedback port */
  45
+		rejectUnauthorized: true,  /* Set this to false incase using a local proxy, reject otherwise */
45 46
 		feedback: false,					/* enable feedback service, set to callback */
46 47
 		errorCallback: false,				/* error handler to catch connection exceptions */
47 48
 		interval: 3600,						/* interval in seconds to connect to feedback service */
@@ -135,17 +136,13 @@ Feedback.prototype.connect = function () {
135 136
 		socketOptions.cert = this.certData;
136 137
 		socketOptions.passphrase = this.options.passphrase;
137 138
 		socketOptions.ca = this.options.ca;
  139
+		socketOptions.rejectUnauthorized = this.options.rejectUnauthorized;
138 140
 		
139 141
 		this.socket = tls.connect(
140 142
 			this.options['port'],
141 143
 			this.options['address'],
142 144
 			socketOptions,
143 145
 			function () {
144  
-				if (!this.socket.authorized) {
145  
-					this.deferredConnection.reject(this.socket.authorizationError);
146  
-					this.deferredConnection = null;
147  
-				}
148  
-				
149 146
 				debug("Connection established");
150 147
 				this.deferredConnection.resolve();
151 148
 			}.bind(this));

0 notes on commit 1ec14c8

Please sign in to comment.
Something went wrong with that request. Please try again.