@@ -10,14 +10,16 @@ use Text::Diff;
1010
1111my $tests = 0;
1212my $prg =" ./testssl.sh" ;
13- my $uri =" heise.de " ;
13+ my $uri =" github.com " ;
1414my $out =" " ;
1515my $html =" " ;
1616my $debughtml =" " ;
1717my $edited_html =" " ;
1818my $htmlfile =" tmp.html" ;
19- my $check2run =" --ip=one --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 " ;
2021my $diff =" " ;
22+ my $ip =" " ;
2123die " Unable to open $prg " unless -f $prg ;
2224
2325printf " \n %s \n " , " Doing HTML output checks" ;
@@ -54,6 +56,13 @@ ok($edited_html eq $out, "Checking if HTML file matches terminal output") or
5456$tests ++;
5557
5658
59+ if ( $^O eq " darwin" ){
60+ printf " \n skip debug check on MacOS\n\n " ;
61+ done_testing($tests );
62+ exit 0;
63+ }
64+
65+
5766# 2
5867printf " %s \n " , " .. running again $prg against \" $uri \" , now with --debug 4 to create HTML output (may take another ~2 minutes)" ;
5968# Redirect stderr to /dev/null in order to avoid some unexplained "date: invalid date" error messages
@@ -78,8 +87,21 @@ $debughtml =~ s/.*DEBUG:.*\n//g;
7887$debughtml =~ s / No engine or GOST support via engine with your.*\n // g ;
7988$debughtml =~ s / .*built: .*\n // g ;
8089$debughtml =~ s / .*Using bash .*\n // g ;
90+ $debughtml =~ s / .*has_compression.*\n // g ;
8191# is whole line: s/.*<pattern> .*\n//g;
8292
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+
83105$diff = diff \$debughtml , \$html ;
84106
85107ok($debughtml eq $html , " Checking if HTML file created with --debug 4 matches HTML file created without --debug" ) or
0 commit comments