Skip to content

Commit

Permalink
[fix] Partial fix for rejecting self-signed certs in tests
Browse files Browse the repository at this point in the history
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
mmalecki committed Sep 27, 2012
1 parent eafdc74 commit 2e7d8a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion examples/http/proxy-https-to-https.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions test/helpers/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion test/macros/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -320,4 +321,4 @@ exports.assertProxiedToRoutes = function (options, nested) {
}

return context;
};
};

4 comments on commit 2e7d8a8

@subnetmarco
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@mmalecki
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It became supported since eafdc74. Agent accepts rejectUnauthorized.

@subnetmarco
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@mmalecki
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.