Skip to content

Commit 0edaf01

Browse files
abmussedanielleadams
authored andcommitted
test: fallback to IPv4 if IPv6 is unavailable
openssl seems to default to use IPv6. This change adds a checks if IPv6 is unavailable and uses IPv4 instead. On the Node.js CI IBM i build system IPv6 is currently disabled. This change should resolve the following test case failures: - https://ci.nodejs.org/job/node-test-commit-ibmi/nodes=ibmi73-ppc64/1085/testReport/(root)/test/sequential_test_tls_psk_client_/ - https://ci.nodejs.org/job/node-test-commit-ibmi/nodes=ibmi73-ppc64/1085/testReport/(root)/test/sequential_test_tls_securepair_client_/ PR-URL: #47017 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent a3f272e commit 0edaf01

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

test/sequential/test-tls-psk-client.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const { spawn } = require('child_process');
1414
const CIPHERS = 'PSK+HIGH';
1515
const KEY = 'd731ef57be09e5204f0b205b60627028';
1616
const IDENTITY = 'Client_identity'; // Hardcoded by `openssl s_server`
17+
const useIPv4 = !common.hasIPv6;
1718

1819
const server = spawn(common.opensslCli, [
1920
's_server',
@@ -23,6 +24,7 @@ const server = spawn(common.opensslCli, [
2324
'-psk_hint', IDENTITY,
2425
'-nocert',
2526
'-rev',
27+
...(useIPv4 ? ['-4'] : []),
2628
], { encoding: 'utf8' });
2729
let serverErr = '';
2830
let serverOut = '';

test/sequential/test-tls-securepair-client.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ const fixtures = require('../common/fixtures');
3838
const tls = require('tls');
3939
const spawn = require('child_process').spawn;
4040

41+
const useIPv4 = !common.hasIPv6;
42+
4143
test1();
4244

4345
// simple/test-tls-securepair-client
@@ -64,7 +66,9 @@ function test(keyPath, certPath, check, next) {
6466
const server = spawn(common.opensslCli, ['s_server',
6567
'-accept', 0,
6668
'-cert', fixtures.path(certPath),
67-
'-key', fixtures.path(keyPath)]);
69+
'-key', fixtures.path(keyPath),
70+
...(useIPv4 ? ['-4'] : []),
71+
]);
6872
server.stdout.pipe(process.stdout);
6973
server.stderr.pipe(process.stdout);
7074

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy