mirror of
https://github.com/nodejs/node.git
synced 2025-05-05 15:32:15 +00:00

PR-URL: https://github.com/nodejs/node/pull/10899 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
23 lines
557 B
JavaScript
23 lines
557 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, key, port: common.PORT}, common.fail);
|
|
conn.on('error', function() {
|
|
});
|
|
assert.doesNotThrow(function() {
|
|
conn.destroy();
|
|
});
|