Skip to content

Commit 2e7d8a8

Browse files
committed
[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.
1 parent eafdc74 commit 2e7d8a8

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Diff for: examples/http/proxy-https-to-https.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ https.createServer(helpers.https, function (req, res) {
4646
httpProxy.createServer(8000, 'localhost', {
4747
https: helpers.https,
4848
target: {
49-
https: true
49+
https: true,
50+
rejectUnauthorized: false
5051
}
5152
}).listen(8080);
5253

Diff for: test/helpers/http.js

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ exports.createProxyServer = function (options, callback) {
9191
if (protocols.proxy === 'https') {
9292
options.proxy.https = helpers.https;
9393
}
94+
options.proxy.rejectUnauthorized = false;
9495

9596
return httpProxy
9697
.createServer(options.proxy)

Diff for: test/macros/http.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ exports.assertRequest = function (options) {
2727
//
2828
// Now make the HTTP request and assert.
2929
//
30+
options.request.rejectUnauthorized = false;
3031
request(options.request, this.callback);
3132
},
3233
"should succeed": function (err, res, body) {
@@ -320,4 +321,4 @@ exports.assertProxiedToRoutes = function (options, nested) {
320321
}
321322

322323
return context;
323-
};
324+
};

0 commit comments

Comments
 (0)