summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedor Indutny <fedor@indutny.com>2015-07-18 12:36:20 -0700
committerFedor Indutny <fedor@indutny.com>2015-07-20 11:47:06 -0700
commit22997731e60eeb84b1e03ff438710ff219b46854 (patch)
treea4a39a9c2573ce06492e171c48a6ea585ebf5ade
parent75697112e85b66e697db600d9238caff0ef69e0d (diff)
downloadnode-22997731e60eeb84b1e03ff438710ff219b46854.tar.gz
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
-rw-r--r--test/simple/test-tls-new-session-hang.js43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/simple/test-tls-new-session-hang.js b/test/simple/test-tls-new-session-hang.js
new file mode 100644
index 000000000..e2f309508
--- /dev/null
+++ b/test/simple/test-tls-new-session-hang.js
@@ -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();
+ });
+});