Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fallback to IPv4 if IPv6 is unavailable #47017

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/sequential/test-tls-psk-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const { spawn } = require('child_process');
const CIPHERS = 'PSK+HIGH';
const KEY = 'd731ef57be09e5204f0b205b60627028';
const IDENTITY = 'Client_identity'; // Hardcoded by `openssl s_server`
const useIPv4 = common.hasIPv6 ? false : true;
abmusse marked this conversation as resolved.
Show resolved Hide resolved

const server = spawn(common.opensslCli, [
's_server',
Expand All @@ -23,6 +24,7 @@ const server = spawn(common.opensslCli, [
'-psk_hint', IDENTITY,
'-nocert',
'-rev',
...(useIPv4 ? ['-4'] : []),
], { encoding: 'utf8' });
let serverErr = '';
let serverOut = '';
Expand Down
6 changes: 5 additions & 1 deletion test/sequential/test-tls-securepair-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ const fixtures = require('../common/fixtures');
const tls = require('tls');
const spawn = require('child_process').spawn;

const useIPv4 = common.hasIPv6 ? false : true;
abmusse marked this conversation as resolved.
Show resolved Hide resolved

test1();

// simple/test-tls-securepair-client
Expand All @@ -64,7 +66,9 @@ function test(keyPath, certPath, check, next) {
const server = spawn(common.opensslCli, ['s_server',
'-accept', 0,
'-cert', fixtures.path(certPath),
'-key', fixtures.path(keyPath)]);
'-key', fixtures.path(keyPath),
...(useIPv4 ? ['-4'] : []),
]);
server.stdout.pipe(process.stdout);
server.stderr.pipe(process.stdout);

Expand Down