mirror of
https://github.com/nodejs/node.git
synced 2025-05-01 08:42:45 +00:00

Lots of changes, but mostly just search/replace of fixtures.readSync(...) to fixtures.readKey([new key]...) Benchmarks modified to use fixtures.readKey(...): benchmark/tls/throughput.js benchmark/tls/tls-connect.js benchmark/tls/secure-pair.js Also be sure to review the change to L16 of test/parallel/test-crypto-sign-verify.js PR-URL: https://github.com/nodejs/node/pull/27962 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
26 lines
702 B
JavaScript
26 lines
702 B
JavaScript
'use strict';
|
|
|
|
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 sslcontext = tls.createSecureContext({
|
|
cert: fixtures.readKey('rsa_cert.crt'),
|
|
key: fixtures.readKey('rsa_private.pem')
|
|
});
|
|
|
|
const pair = tls.createSecurePair(sslcontext, true, false, false, {
|
|
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');
|
|
|
|
pair.encrypted.write(sslHello);
|