mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
7a0e462f9f
Manually fix issues that eslint --fix couldn't do automatically. PR-URL: https://github.com/nodejs/node/pull/10685 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
41 lines
839 B
JavaScript
41 lines
839 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
if (!common.hasCrypto) {
|
|
common.skip('node compiled without crypto.');
|
|
return;
|
|
}
|
|
|
|
const assert = require('assert');
|
|
const tls = require('tls');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const pfx = fs.readFileSync(
|
|
path.join(common.fixturesDir, 'keys', 'agent1-pfx.pem'));
|
|
|
|
const server = tls.createServer({
|
|
pfx: pfx,
|
|
passphrase: 'sample',
|
|
requestCert: true,
|
|
rejectUnauthorized: false
|
|
}, common.mustCall(function(c) {
|
|
assert.strictEqual(
|
|
c.authorizationError,
|
|
null,
|
|
'authorizationError must be 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();
|
|
});
|
|
});
|