mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 21:25:20 +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>
25 lines
628 B
JavaScript
25 lines
628 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
|
|
if (!common.hasCrypto) {
|
|
common.skip('missing crypto');
|
|
return;
|
|
}
|
|
const tls = require('tls');
|
|
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const cert = fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem'));
|
|
const key = fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem'));
|
|
|
|
const conn = tls.connect({cert: cert, key: key, port: common.PORT}, function() {
|
|
assert.ok(false); // callback should never be executed
|
|
});
|
|
conn.on('error', function() {
|
|
});
|
|
assert.doesNotThrow(function() {
|
|
conn.destroy();
|
|
});
|