node/test/parallel/test-https-unix-socket-self-signed.js
Maurice Hayward abf8bae475
test: use fixtures module
PR-URL: https://github.com/nodejs/node/pull/16034
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-10-09 02:13:20 -07:00

27 lines
575 B
JavaScript

'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
common.refreshTmpDir();
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
});
}));