GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: adapt tests for OpenSSL 3.1 · nodejs/node@9875885

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test
    • common
      • index.js
    • parallel
      • test-https-agent-session-eviction.js
      • test-tls-alert.js
      • test-tls-getprotocol.js
      • test-tls-min-max-version.js
      • test-tls-session-cache.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/common/index.js‎

Copy file name to clipboardExpand all lines: test/common/index.js
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ const hasCrypto = Boolean(process.versions.openssl) &&
5757
!process.env.NODE_SKIP_CRYPTO;
5858

5959
const hasOpenSSL3 = hasCrypto &&
60-
require('crypto').constants.OPENSSL_VERSION_NUMBER >= 805306368;
60+
require('crypto').constants.OPENSSL_VERSION_NUMBER >= 0x30000000;
61+
62+
const hasOpenSSL31 = hasCrypto &&
63+
require('crypto').constants.OPENSSL_VERSION_NUMBER >= 0x30100000;
6164

6265
const hasQuic = hasCrypto && !!process.config.variables.openssl_quic;
6366

@@ -911,6 +914,7 @@ const common = {
911914
hasIntl,
912915
hasCrypto,
913916
hasOpenSSL3,
917+
hasOpenSSL31,
914918
hasQuic,
915919
hasMultiLocalhost,
916920
invalidArgTypeHelper,
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-https-agent-session-eviction.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ function faultyServer(port) {
5656
function second(server, session) {
5757
const req = https.request({
5858
port: server.address().port,
59+
ciphers: (common.hasOpenSSL31 ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT'),
5960
rejectUnauthorized: false
6061
}, function(res) {
6162
res.resume();
Collapse file

‎test/parallel/test-tls-alert.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-tls-alert.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const server = tls.Server({
4242
cert: loadPEM('agent2-cert')
4343
}, null).listen(0, common.mustCall(() => {
4444
const args = ['s_client', '-quiet', '-tls1_1',
45+
'-cipher', (common.hasOpenSSL31 ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT'),
4546
'-connect', `127.0.0.1:${server.address().port}`];
4647

4748
execFile(common.opensslCli, args, common.mustCall((err, _, stderr) => {
Collapse file

‎test/parallel/test-tls-getprotocol.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-tls-getprotocol.js
+13-3Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,18 @@ const tls = require('tls');
1111
const fixtures = require('../common/fixtures');
1212

1313
const clientConfigs = [
14-
{ secureProtocol: 'TLSv1_method', version: 'TLSv1' },
15-
{ secureProtocol: 'TLSv1_1_method', version: 'TLSv1.1' },
16-
{ secureProtocol: 'TLSv1_2_method', version: 'TLSv1.2' },
14+
{
15+
secureProtocol: 'TLSv1_method',
16+
version: 'TLSv1',
17+
ciphers: (common.hasOpenSSL31 ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT')
18+
}, {
19+
secureProtocol: 'TLSv1_1_method',
20+
version: 'TLSv1.1',
21+
ciphers: (common.hasOpenSSL31 ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT')
22+
}, {
23+
secureProtocol: 'TLSv1_2_method',
24+
version: 'TLSv1.2'
25+
},
1726
];
1827

1928
const serverConfig = {
@@ -30,6 +39,7 @@ const server = tls.createServer(serverConfig, common.mustCall(clientConfigs.leng
3039
tls.connect({
3140
host: common.localhostIPv4,
3241
port: server.address().port,
42+
ciphers: v.ciphers,
3343
rejectUnauthorized: false,
3444
secureProtocol: v.secureProtocol
3545
}, common.mustCall(function() {
Collapse file

‎test/parallel/test-tls-min-max-version.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-tls-min-max-version.js
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ function test(cmin, cmax, cprot, smin, smax, sprot, proto, cerr, serr) {
2222
if (serr !== 'ERR_SSL_UNSUPPORTED_PROTOCOL')
2323
ciphers = 'ALL@SECLEVEL=0';
2424
}
25+
if (common.hasOpenSSL31 && cerr === 'ERR_SSL_TLSV1_ALERT_PROTOCOL_VERSION') {
26+
ciphers = 'DEFAULT@SECLEVEL=0';
27+
}
2528
// Report where test was called from. Strip leading garbage from
2629
// at Object.<anonymous> (file:line)
2730
// from the stack location, we only want the file:line part.
Collapse file

‎test/parallel/test-tls-session-cache.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-tls-session-cache.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ function doTest(testOptions, callback) {
100100
const args = [
101101
's_client',
102102
'-tls1',
103+
'-cipher', (common.hasOpenSSL31 ? 'DEFAULT:@SECLEVEL=0' : 'DEFAULT'),
103104
'-connect', `localhost:${this.address().port}`,
104105
'-servername', 'ohgod',
105106
'-key', fixtures.path('keys/rsa_private.pem'),

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.