-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
|
||
if (!common.hasCrypto) { | ||
common.skip('missing crypto'); | ||
return; | ||
} | ||
|
||
common.refreshTmpDir(); | ||
|
||
const fs = require('fs'); | ||
const https = require('https'); | ||
const options = { | ||
cert: fs.readFileSync(common.fixturesDir + '/test_cert.pem'), | ||
key: fs.readFileSync(common.fixturesDir + '/test_key.pem') | ||
}; | ||
|
||
const server = https.createServer(options, common.mustCall((req, res) => { | ||
res.end('bye\n'); | ||
server.close(); | ||
})); | ||
|
||
server.listen(common.PIPE, common.mustCall(() => { | ||
https.get({ | ||
socketPath: common.PIPE, | ||
rejectUnauthorized: false | ||
}); | ||
})); |