mirror of
https://github.com/nodejs/node.git
synced 2025-05-09 13:05:07 +00:00

PR-URL: https://github.com/nodejs/node/pull/14286 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
27 lines
593 B
JavaScript
27 lines
593 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
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
|
|
});
|
|
}));
|