mirror of
https://github.com/nodejs/node.git
synced 2025-05-18 13:11:42 +00:00

Many tests use require() to import modules that subsequently never gets used. This removes those imports and, in a few cases, removes other unused variables from tests. PR-URL: https://github.com/nodejs/node/pull/4475 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
36 lines
788 B
JavaScript
36 lines
788 B
JavaScript
'use strict';
|
|
var common = require('../common');
|
|
var assert = require('assert');
|
|
|
|
if (!common.hasCrypto) {
|
|
console.log('1..0 # Skipped: missing crypto');
|
|
return;
|
|
}
|
|
var tls = require('tls');
|
|
var net = require('net');
|
|
|
|
var success = false;
|
|
|
|
var server = net.Server(function(raw) {
|
|
var pair = tls.createSecurePair(null, true, false, false);
|
|
pair.on('error', function() {});
|
|
pair.ssl.setSNICallback(function() {
|
|
raw.destroy();
|
|
server.close();
|
|
success = true;
|
|
});
|
|
require('_tls_legacy').pipe(pair, raw);
|
|
}).listen(common.PORT, function() {
|
|
tls.connect({
|
|
port: common.PORT,
|
|
rejectUnauthorized: false,
|
|
servername: 'server'
|
|
}, function() {
|
|
}).on('error', function() {
|
|
// Just ignore
|
|
});
|
|
});
|
|
process.on('exit', function() {
|
|
assert(success);
|
|
});
|