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

PR-URL: https://github.com/nodejs/node/pull/16014 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
33 lines
723 B
JavaScript
33 lines
723 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
if (!common.hasCrypto)
|
|
common.skip('node compiled without crypto.');
|
|
|
|
const assert = require('assert');
|
|
const tls = require('tls');
|
|
const fixtures = require('../common/fixtures');
|
|
|
|
const pfx = fixtures.readKey('agent1-pfx.pem');
|
|
|
|
const server = tls.createServer({
|
|
pfx: pfx,
|
|
passphrase: 'sample',
|
|
requestCert: true,
|
|
rejectUnauthorized: false
|
|
}, common.mustCall(function(c) {
|
|
assert.strictEqual(c.authorizationError, null);
|
|
c.end();
|
|
})).listen(0, function() {
|
|
const client = tls.connect({
|
|
port: this.address().port,
|
|
pfx: pfx,
|
|
passphrase: 'sample',
|
|
rejectUnauthorized: false
|
|
}, function() {
|
|
client.end();
|
|
server.close();
|
|
});
|
|
});
|