Skip to content

Commit 56c1e58

Browse files
committed
Mask IP addresses, change host, compression
... for t/32_isHTML_valid.t . Github.com seems to be most reliable from the ones tested so far. bahn.de has one IP to the outside however Session resumption seems to come from different hosts behind that IP. Bad choice for this test.
1 parent faa1903 commit 56c1e58

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

t/32_isHTML_valid.t

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ use Text::Diff;
1010

1111
my $tests = 0;
1212
my $prg="./testssl.sh";
13-
my $uri="bahn.de";
13+
my $uri="github.com";
1414
my $out="";
1515
my $html="";
1616
my $debughtml="";
1717
my $edited_html="";
1818
my $htmlfile="tmp.html";
19-
# need to avoid the debug message around L15190++ Your ./bin/openssl.Linux.x86_64 doesn't support X25519 :
20-
my $check2run="--ip=one --openssl /usr/bin/openssl --sneaky --ids-friendly --color 0 --htmlfile $htmlfile";
19+
# Pick /usr/bin/openssl as we want to avoid the debug messages like "Your ./bin/openssl.Linux.x86_64 doesn't support X25519"
20+
my $check2run="--ip=one -4 --openssl /usr/bin/openssl --sneaky --ids-friendly --color 0 --htmlfile $htmlfile";
2121
my $diff="";
22-
22+
my $ip="";
2323
die "Unable to open $prg" unless -f $prg;
2424

2525
printf "\n%s\n", "Doing HTML output checks";
@@ -57,7 +57,7 @@ $tests++;
5757

5858

5959
if ( $^O eq "darwin" ){
60-
printf "\nskip debug checkon MacOS\n\n";
60+
printf "\nskip debug check on MacOS\n\n";
6161
done_testing($tests);
6262
exit 0;
6363
}
@@ -87,8 +87,21 @@ $debughtml =~ s/.*DEBUG:.*\n//g;
8787
$debughtml =~ s/No engine or GOST support via engine with your.*\n//g;
8888
$debughtml =~ s/.*built: .*\n//g;
8989
$debughtml =~ s/.*Using bash .*\n//g;
90+
$debughtml =~ s/.*has_compression.*\n//g;
9091
# is whole line: s/.*<pattern> .*\n//g;
9192

93+
# Extract and mask IP address as it can change
94+
if ( $html =~ /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/ ) {
95+
$ip = $1;
96+
}
97+
$html =~ s/$ip/AAA.BBB.CCC.DDD/g;
98+
99+
if ( $debughtml =~ /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/ ) {
100+
$ip = $1;
101+
}
102+
$debughtml =~ s/$ip/AAA.BBB.CCC.DDD/g;
103+
104+
92105
$diff = diff \$debughtml, \$html;
93106

94107
ok($debughtml eq $html, "Checking if HTML file created with --debug 4 matches HTML file created without --debug") or

0 commit comments

Comments
 (0)