mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
test: add regression test for #25735
See: https://github.com/joyent/node/issues/25736 Reviewed-By: Fedor Indutny <fedor@indutny.com> PR-URL: https://github.com/joyent/node/pull/25739
This commit is contained in:
1 parent
75697112e8
commit
22997731e6
1 file changed
+43
@@ -0,0 +1,43 @@
|
||||
var common = require('../common');
|
||||
|
||||
if (!process.features.tls_ocsp) {
|
||||
console.error('Skipping because node compiled without OpenSSL or ' +
|
||||
'with old OpenSSL version.');
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
var assert = require('assert');
|
||||
var tls = require('tls');
|
||||
var constants = require('constants');
|
||||
var fs = require('fs');
|
||||
var join = require('path').join;
|
||||
|
||||
var keyFile = join(common.fixturesDir, 'keys', 'agent1-key.pem');
|
||||
var certFile = join(common.fixturesDir, 'keys', 'agent1-cert.pem');
|
||||
var caFile = join(common.fixturesDir, 'keys', 'ca1-cert.pem');
|
||||
var key = fs.readFileSync(keyFile);
|
||||
var cert = fs.readFileSync(certFile);
|
||||
|
||||
var server = tls.createServer({
|
||||
cert: cert,
|
||||
key: key
|
||||
}, function (socket) {
|
||||
socket.destroySoon();
|
||||
});
|
||||
|
||||
// Should not be actually called
|
||||
server.on('resumeSession', function (id, callback) {
|
||||
assert(false);
|
||||
});
|
||||
|
||||
server.listen(common.PORT, function() {
|
||||
var client = tls.connect({
|
||||
rejectUnauthorized: false,
|
||||
port: common.PORT,
|
||||
|
||||
// Just to make sure that `newSession` is going to be called
|
||||
secureOptions: constants.SSL_OP_NO_TICKET
|
||||
}, function() {
|
||||
server.close();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user