Skip to content

Commit 14bd26c

Browse files
sam-githubBridgeAR
authored andcommitted
test: remove workaround for unsupported OpenSSLs
Workaround added in d9b9229 is no longer needed, since OpenSSL versions lower than 1.1.1 are unsupported. PR-URL: #28085 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 8984b73 commit 14bd26c

File tree

1 file changed

+7
-35
lines changed

1 file changed

+7
-35
lines changed

test/parallel/test-https-agent-session-eviction.js

+7-35
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ const { readKey } = require('../common/fixtures');
77
if (!common.hasCrypto)
88
common.skip('missing crypto');
99

10-
const assert = require('assert');
1110
const https = require('https');
12-
const { OPENSSL_VERSION_NUMBER, SSL_OP_NO_TICKET } =
13-
require('crypto').constants;
11+
const { SSL_OP_NO_TICKET } = require('crypto').constants;
1412

1513
const options = {
1614
key: readKey('agent1-key.pem'),
@@ -60,38 +58,12 @@ function second(server, session) {
6058
res.resume();
6159
});
6260

63-
if (OPENSSL_VERSION_NUMBER >= 0x10100000) {
64-
// Although we have a TLS 1.2 session to offer to the TLS 1.0 server,
65-
// connection to the TLS 1.0 server should work.
66-
req.on('response', common.mustCall(function(res) {
67-
// The test is now complete for OpenSSL 1.1.0.
68-
server.close();
69-
}));
70-
} else {
71-
// OpenSSL 1.0.x mistakenly locked versions based on the session it was
72-
// offering. This causes this sequent request to fail. Let it fail, but
73-
// test that this is mitigated on the next try by invalidating the session.
74-
req.on('error', common.mustCall(function(err) {
75-
assert(/wrong version number/.test(err.message));
76-
77-
req.on('close', function() {
78-
third(server);
79-
});
80-
}));
81-
}
82-
req.end();
83-
}
84-
85-
// Try one more time - session should be evicted!
86-
function third(server) {
87-
const req = https.request({
88-
port: server.address().port,
89-
rejectUnauthorized: false
90-
}, function(res) {
91-
res.resume();
92-
assert(!req.socket.isSessionReused());
61+
// Although we have a TLS 1.2 session to offer to the TLS 1.0 server,
62+
// connection to the TLS 1.0 server should work.
63+
req.on('response', common.mustCall(function(res) {
64+
// The test is now complete for OpenSSL 1.1.0.
9365
server.close();
94-
});
95-
req.on('error', common.mustNotCall());
66+
}));
67+
9668
req.end();
9769
}

0 commit comments

Comments
 (0)