mirror of
https://github.com/nodejs/node.git
synced 2025-05-12 14:37:22 +00:00

This commit allows self signed certificates to work with unix sockets by forwarding the rejectUnauthorized option. Fixes: https://github.com/nodejs/node/issues/13470 PR-URL: https://github.com/nodejs/node/pull/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>
29 lines
607 B
JavaScript
29 lines
607 B
JavaScript
'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
|
|
});
|
|
}));
|