mirror of
https://github.com/nodejs/node.git
synced 2025-05-10 17:57:53 +00:00

`options.server` only needs to be set when its contents are actually being inspected. PR-URL: https://github.com/nodejs/node/pull/17835 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
27 lines
763 B
JavaScript
27 lines
763 B
JavaScript
'use strict';
|
|
|
|
// This is based on test-tls-securepair-fiftharg.js
|
|
// for the deprecated `tls.createSecurePair()` variant.
|
|
|
|
const common = require('../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const assert = require('assert');
|
|
const tls = require('tls');
|
|
const fixtures = require('../common/fixtures');
|
|
const makeDuplexPair = require('../common/duplexpair');
|
|
|
|
const { clientSide, serverSide } = makeDuplexPair();
|
|
new tls.TLSSocket(serverSide, {
|
|
isServer: true,
|
|
SNICallback: common.mustCall((servername, cb) => {
|
|
assert.strictEqual(servername, 'www.google.com');
|
|
})
|
|
});
|
|
|
|
// captured traffic from browser's request to https://www.google.com
|
|
const sslHello = fixtures.readSync('google_ssl_hello.bin');
|
|
|
|
clientSide.write(sslHello);
|