forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
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. Backport-PR-URL: nodejs#14415 Fixes: nodejs#13470 PR-URL: nodejs#13505 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
- Loading branch information
1 parent
f66f09f
commit 0130298
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 | ||
}); | ||
})); |