Sha256: cd8bec3bbfa7da379ddfcc6fd4fde70771207cdf1ef284761bafd4aa42b24b72

Contents?: true

Size: 1 KB

Versions: 5

Compression:

Stored size: 1 KB

Contents

'use strict';

const common = require('../common');

if (!process.features.tls_sni) {
  console.log('1..0 # Skipped: node compiled without OpenSSL or ' +
              'with old OpenSSL version.');
  return;
}

const assert = require('assert');

if (!common.hasCrypto) {
  console.log('1..0 # Skipped: missing crypto');
  return;
}

const tls = require('tls');

const options = {
  SNICallback: (name, callback) => {
    callback(null, tls.createSecureContext());
  }
};

const server = tls.createServer(options, (c) => {
  common.fail('Should not be called');
}).on('tlsClientError', common.mustCall((err, c) => {
  assert(/SSL_use_certificate:passed a null parameter/i.test(err.message));
  server.close();
})).listen(0, common.mustCall(() => {
  const c = tls.connect({
    port: server.address().port,
    rejectUnauthorized: false,
    servername: 'any.name'
  }, () => {
    common.fail('Should not be called');
  });

  c.on('error', common.mustCall((err) => {
    assert(/socket hang up/.test(err.message));
  }));
}));

Version data entries

5 entries across 4 versions & 1 rubygems

Version Path
node-compiler-0.9.1 vendor/node/test/parallel/test-tls-empty-sni-context.js
node-compiler-0.9.0 vendor/node-v7.2.1/test/parallel/test-tls-empty-sni-context.js
node-compiler-0.8.0 vendor/node-v7.2.0/test/parallel/test-tls-empty-sni-context.js
node-compiler-0.7.0 vendor/node-v6.9.1/test/parallel/test-tls-empty-sni-context.js
node-compiler-0.7.0 vendor/node-v7.1.0/test/parallel/test-tls-empty-sni-context.js