node/test/parallel/test-https-unix-socket-self-signed.js
Sam Roberts 965ffc4cb9 Revert "test: move all test keys/certs under test/fixtures/keys/"
PR-URL: https://github.com/nodejs/node/pull/28083
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Refael Ackermann (רפאל פלחי) <refack@gmail.com>
2019-06-05 19:01:13 -04:00

28 lines
613 B
JavaScript

'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const tmpdir = require('../common/tmpdir');
tmpdir.refresh();
const fixtures = require('../common/fixtures');
const https = require('https');
const options = {
cert: fixtures.readSync('test_cert.pem'),
key: fixtures.readSync('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
});
}));