var sslcontext = crypto.createCredentials(options);
- convertNPNProtocols(options.NPNProtocols, this);
+ var NPN = {};
+ convertNPNProtocols(options.NPNProtocols, NPN);
var hostname = options.servername || options.host || 'localhost',
pair = new SecurePair(sslcontext, false, true,
options.rejectUnauthorized === true ? true : false,
{
- NPNProtocols: this.NPNProtocols,
+ NPNProtocols: NPN.NPNProtocols,
servername: hostname,
cleartext: options.cleartext,
encrypted: options.encrypted
key: serverOptions.key,
cert: serverOptions.cert,
crl: serverOptions.crl,
+ rejectUnauthorized: false
+},{
+ port: serverPort,
+ key: serverOptions.key,
+ cert: serverOptions.cert,
+ crl: serverOptions.crl,
NPNProtocols: ['first-priority-unsupported', 'x', 'y'],
rejectUnauthorized: false
}];
connectClient(clientsOptions[0], function() {
connectClient(clientsOptions[1], function() {
connectClient(clientsOptions[2], function() {
- server.close();
+ connectClient(clientsOptions[3], function() {
+ server.close();
+ });
});
});
});
process.on('exit', function() {
assert.equal(serverResults[0], clientsResults[0]);
assert.equal(serverResults[1], clientsResults[1]);
- assert.equal(serverResults[2], 'first-priority-unsupported');
+ assert.equal(serverResults[2], 'http/1.1');
assert.equal(clientsResults[2], false);
+ assert.equal(serverResults[3], 'first-priority-unsupported');
+ assert.equal(clientsResults[3], false);
});