Browse Source

[tests] detect multiple SSL/TLS/crypto providers

master
Glenn Strauss 7 months ago
parent
commit
a363383a92
  1. 13
      tests/LightyTest.pm
  2. 2
      tests/mod-secdownload.t

13
tests/LightyTest.pm

@ -457,4 +457,17 @@ sub has_feature {
return 0;
}
sub has_crypto {
# quick-n-dirty crude parse of "lighttpd -V"
# (XXX: should be run on demand and only once per instance, then cached)
my ($self) = @_;
my $FH;
open($FH, "-|",$self->{LIGHTTPD_PATH}, "-V") || return 0;
while (<$FH>) {
return 1 if (/[+] (?i:OpenSSL|mbedTLS|GnuTLS|WolfSSL|Nettle) support/);
}
close $FH;
return 0;
}
1;

2
tests/mod-secdownload.t

@ -81,7 +81,7 @@ $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 404 } ];
ok($tf->handle_http($t) == 0, 'secdownload - timeout (md5)');
if (!$tf->has_feature("SSL support")) {
if (!$tf->has_crypto()) {
for (1..4) { ok(1, "secdownload (hmac-sha1) (skipped) - (missing SSL support)"); }
for (1..5) { ok(1, "secdownload (hmac-sha256) (skipped) - (missing SSL support)"); }

Loading…
Cancel
Save