summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2017-09-23 04:07:58 -0400
committerRod Vagg <rod@vagg.org>2017-11-11 20:42:50 +1100
commitd9b9229d98afb4b3f01e73c619c5fede0f87138f (patch)
tree1b26b7483570908f41eb5e7a6b9d68ca570f0fb6 /test
parente433afa65245d2aa2eff84da1c2f69db83460cbe (diff)
downloadandroid-node-v8-d9b9229d98afb4b3f01e73c619c5fede0f87138f.tar.gz
android-node-v8-d9b9229d98afb4b3f01e73c619c5fede0f87138f.tar.bz2
android-node-v8-d9b9229d98afb4b3f01e73c619c5fede0f87138f.zip
test: fix test-https-agent-session-eviction for 1.1
This test is testing the workaround for an OpenSSL 1.0.x bug, which was fixed in 1.1.0. With the bug fixed, the test expectations need to change slightly. PR-URL: https://github.com/nodejs/node/pull/16130 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rod Vagg <rod@vagg.org>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-https-agent-session-eviction.js28
1 files changed, 20 insertions, 8 deletions
diff --git a/test/parallel/test-https-agent-session-eviction.js b/test/parallel/test-https-agent-session-eviction.js
index 616604124a..cf6a1341c1 100644
--- a/test/parallel/test-https-agent-session-eviction.js
+++ b/test/parallel/test-https-agent-session-eviction.js
@@ -8,7 +8,8 @@ if (!common.hasCrypto)
const assert = require('assert');
const https = require('https');
-const SSL_OP_NO_TICKET = require('crypto').constants.SSL_OP_NO_TICKET;
+const { OPENSSL_VERSION_NUMBER, SSL_OP_NO_TICKET } =
+ require('crypto').constants;
const options = {
key: readKey('agent1-key.pem'),
@@ -58,14 +59,25 @@ function second(server, session) {
res.resume();
});
- // Let it fail
- req.on('error', common.mustCall(function(err) {
- assert(/wrong version number/.test(err.message));
+ if (OPENSSL_VERSION_NUMBER >= 0x10100000) {
+ // Although we have a TLS 1.2 session to offer to the TLS 1.0 server,
+ // connection to the TLS 1.0 server should work.
+ req.on('response', common.mustCall(function(res) {
+ // The test is now complete for OpenSSL 1.1.0.
+ server.close();
+ }));
+ } else {
+ // OpenSSL 1.0.x mistakenly locked versions based on the session it was
+ // offering. This causes this sequent request to fail. Let it fail, but
+ // test that this is mitigated on the next try by invalidating the session.
+ req.on('error', common.mustCall(function(err) {
+ assert(/wrong version number/.test(err.message));
- req.on('close', function() {
- third(server);
- });
- }));
+ req.on('close', function() {
+ third(server);
+ });
+ }));
+ }
req.end();
}