diff --git a/tests/LightyTest.pm b/tests/LightyTest.pm index 5b5d60af..a11c5d8a 100644 --- a/tests/LightyTest.pm +++ b/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; diff --git a/tests/mod-secdownload.t b/tests/mod-secdownload.t index 3907a944..fcbc5f30 100755 --- a/tests/mod-secdownload.t +++ b/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)"); }