Permalink
Browse files

[fix] Partial fix for rejecting self-signed certs in tests

Since nodejs/node-v0.x-archive@35607f3, https and
tls modules validate server certificate by default. Turn this feature
off since we're using self-signed certificates in tests.

Currently wss tests are still failing, pending investigation.

Commited on a plane from Poznań to Munich.
  • Loading branch information...
1 parent eafdc74 commit 2e7d8a88f4b470dcc9da1639fe2a69e03251036c @mmalecki mmalecki committed Sep 27, 2012
Showing with 5 additions and 2 deletions.
  1. +2 −1 examples/http/proxy-https-to-https.js
  2. +1 −0 test/helpers/http.js
  3. +2 −1 test/macros/http.js
@@ -46,7 +46,8 @@ https.createServer(helpers.https, function (req, res) {
httpProxy.createServer(8000, 'localhost', {
https: helpers.https,
target: {
- https: true
+ https: true,
+ rejectUnauthorized: false
}
}).listen(8080);
View
@@ -91,6 +91,7 @@ exports.createProxyServer = function (options, callback) {
if (protocols.proxy === 'https') {
options.proxy.https = helpers.https;
}
+ options.proxy.rejectUnauthorized = false;
return httpProxy
.createServer(options.proxy)
View
@@ -27,6 +27,7 @@ exports.assertRequest = function (options) {
//
// Now make the HTTP request and assert.
//
+ options.request.rejectUnauthorized = false;
request(options.request, this.callback);
},
"should succeed": function (err, res, body) {
@@ -320,4 +321,4 @@ exports.assertProxiedToRoutes = function (options, nested) {
}
return context;
-};
+};

4 comments on commit 2e7d8a8

Contributor

thefosk replied Sep 27, 2012

Is the option rejectUnauthorized fully supported by the proxy? I cannot find it's reference in the *.js files inside the lib folder.

Contributor

mmalecki replied Sep 27, 2012

It became supported since eafdc74. Agent accepts rejectUnauthorized.

Contributor

thefosk replied Sep 27, 2012

Got it. It will be deployed in v0.8.4, right?

Contributor

mmalecki replied Sep 27, 2012

Yeah. I'll release v0.8.4 once I fix all test failures on node v0.9.

Please sign in to comment.