mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 20:08:02 +00:00

Manually fix issues that eslint --fix couldn't do automatically. PR-URL: https://github.com/nodejs/node/pull/10685 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
28 lines
672 B
JavaScript
28 lines
672 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
if (!common.hasCrypto) {
|
|
common.skip('missing crypto');
|
|
return;
|
|
}
|
|
const tls = require('tls');
|
|
|
|
const fs = require('fs');
|
|
|
|
const options = {
|
|
key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'),
|
|
cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem')
|
|
};
|
|
|
|
common.refreshTmpDir();
|
|
|
|
const server = tls.Server(options, common.mustCall(function(socket) {
|
|
server.close();
|
|
}));
|
|
server.listen(common.PIPE, common.mustCall(function() {
|
|
const options = { rejectUnauthorized: false };
|
|
const client = tls.connect(common.PIPE, options, common.mustCall(function() {
|
|
client.end();
|
|
}));
|
|
}));
|