mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-12-11 17:52:06 +01:00
trying again to make Mac work
This commit is contained in:
@@ -54,29 +54,26 @@ unlike($json_string, qr/$json_errors/, "via sockets checking JSON output");
|
|||||||
$tests++;
|
$tests++;
|
||||||
|
|
||||||
#3
|
#3
|
||||||
if ( $os eq "linux" ){
|
unlink $json_file;
|
||||||
unlink $json_file;
|
$terminal_out = `$prg --ssl-native $check2run $json_file $uri 2>&1`;
|
||||||
$terminal_out = `$prg --ssl-native $check2run $json_file $uri 2>&1`;
|
$json_string = json($json_file);
|
||||||
$json_string = json($json_file);
|
unlike($terminal_out, qr/$openssl_errors/, "via (builtin) OpenSSL, checking terminal output");
|
||||||
unlike($terminal_out, qr/$openssl_errors/, "via (builtin) OpenSSL, checking terminal output");
|
|
||||||
} elsif ( $os eq "darwin" ){
|
|
||||||
printf "%s\n", "Skipping test. The result of the check under MacOS is not understood" ;
|
|
||||||
}
|
|
||||||
$tests++;
|
$tests++;
|
||||||
|
|
||||||
#4
|
#4
|
||||||
unlike($json_string, qr/$json_errors/, "via OpenSSL (builtin) checking JSON output");
|
unlike($json_string, qr/$json_errors/, "via OpenSSL (builtin) checking JSON output");
|
||||||
$tests++;
|
$tests++;
|
||||||
|
|
||||||
#5 -- early data test. We just take the last check
|
if ( $os eq "linux" ){
|
||||||
my $found=0;
|
#5 -- early data test. We just take the last check
|
||||||
open my $fh, '<', $json_file or die "Can't open '$json_file': $!";
|
my $found=0;
|
||||||
local $/; # undef slurp mode
|
open my $fh, '<', $json_file or die "Can't open '$json_file': $!";
|
||||||
my $data = decode_json(<$fh>);
|
local $/; # undef slurp mode
|
||||||
close $fh;
|
my $data = decode_json(<$fh>);
|
||||||
|
close $fh;
|
||||||
|
|
||||||
# Check if the decoded data is an array
|
# Check if the decoded data is an array
|
||||||
if (ref $data eq 'ARRAY') {
|
if (ref $data eq 'ARRAY') {
|
||||||
# Iterate through the array of JSON objects
|
# Iterate through the array of JSON objects
|
||||||
foreach my $obj (@$data) {
|
foreach my $obj (@$data) {
|
||||||
# Check if the 'id' is "early_data" and 'severity' is "HIGH"
|
# Check if the 'id' is "early_data" and 'severity' is "HIGH"
|
||||||
@@ -85,12 +82,15 @@ if (ref $data eq 'ARRAY') {
|
|||||||
last; # we can leave the loop
|
last; # we can leave the loop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($found) {
|
if ($found) {
|
||||||
ok(1, "0‑RTT found in JSON from $uri");
|
ok(1, "0‑RTT found in JSON from $uri");
|
||||||
} else {
|
} else {
|
||||||
fail("0‑RTT test for $uri failed");
|
fail("0‑RTT test for $uri failed");
|
||||||
|
}
|
||||||
|
} elsif ( $os eq "darwin" ){
|
||||||
|
printf "%s\n", "Skipping test. The result of the check under MacOS is not understood" ;
|
||||||
}
|
}
|
||||||
$tests++;
|
$tests++;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user