Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c4cbd99

Browse filesBrowse files
cjihrigaddaleax
authored andcommitted
https: support rejectUnauthorized for unix sockets
This commit allows self signed certificates to work with unix sockets by forwarding the rejectUnauthorized option. Fixes: #13470 PR-URL: #13505 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
1 parent 4d27930 commit c4cbd99
Copy full SHA for c4cbd99

File tree

Expand file treeCollapse file tree

2 files changed

+30
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+30
-1
lines changed
Open diff view settings
Collapse file

‎lib/_http_client.js‎

Copy file name to clipboardExpand all lines: lib/_http_client.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ function ClientRequest(options, cb) {
247247
this.shouldKeepAlive = false;
248248
var optionsPath = {
249249
path: this.socketPath,
250-
timeout: this.timeout
250+
timeout: this.timeout,
251+
rejectUnauthorized: !!options.rejectUnauthorized
251252
};
252253
newSocket = this.agent.createConnection(optionsPath, oncreate);
253254
if (newSocket && !called) {
Collapse file
+28Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
'use strict';
2+
const common = require('../common');
3+
4+
if (!common.hasCrypto) {
5+
common.skip('missing crypto');
6+
return;
7+
}
8+
9+
common.refreshTmpDir();
10+
11+
const fs = require('fs');
12+
const https = require('https');
13+
const options = {
14+
cert: fs.readFileSync(common.fixturesDir + '/test_cert.pem'),
15+
key: fs.readFileSync(common.fixturesDir + '/test_key.pem')
16+
};
17+
18+
const server = https.createServer(options, common.mustCall((req, res) => {
19+
res.end('bye\n');
20+
server.close();
21+
}));
22+
23+
server.listen(common.PIPE, common.mustCall(() => {
24+
https.get({
25+
socketPath: common.PIPE,
26+
rejectUnauthorized: false
27+
});
28+
}));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.