Skip to content

Commit 028d19a

Browse files
committed
Tests: adjusted TODO for OpenSSL 1.0.2h and up in h2_http2.t.
OpenSSL uses correct SNI/ALPN callback order (SNI callback before ALPN callback) starting with OpenSSL 1.0.2h, so "sni to enabled" test is expected to succeed starting with OpenSSL 1.0.2h. With this change, the "openssl:..." feature test now supports checking patch level encoded as letters, such as in "openssl:1.0.2h".
1 parent e0cddf7 commit 028d19a

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

h2_http2.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ ok(!get_ssl_socket(8444), 'default to disabled');
151151
TODO: {
152152
local $TODO = 'broken ALPN/SNI order in LibreSSL'
153153
if $t->has_module('LibreSSL');
154-
local $TODO = 'OpenSSL too old'
154+
local $TODO = 'broken ALPN/SNI order in OpenSSL before 1.0.2h'
155155
if $t->has_module('OpenSSL')
156-
and not $t->has_feature('openssl:1.1.0');
156+
and not $t->has_feature('openssl:1.0.2h');
157157

158158
is(get_https(8444, 'http2'), 200, 'sni to enabled');
159159

lib/Test/Nginx.pm

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,20 +266,22 @@ sub has_feature($) {
266266
return 0;
267267
}
268268

269-
if ($feature =~ /^(openssl|libressl):([0-9.]+)/) {
269+
if ($feature =~ /^(openssl|libressl):([0-9.]+)([a-z]*)/) {
270270
my $library = $1;
271271
my $need = $2;
272+
my $patch = $3;
272273

273274
$self->{_configure_args} = `$NGINX -V 2>&1`
274275
if !defined $self->{_configure_args};
275276

276277
return 0 unless
277-
$self->{_configure_args} =~ /with $library ([0-9.]+)/i;
278+
$self->{_configure_args}
279+
=~ /with $library ([0-9.]+)([a-z]*)/i;
278280

279-
my @v = split(/\./, $1);
281+
my @v = (split(/\./, $1), unpack("C*", $2));
280282
my ($n, $v);
281283

282-
for $n (split(/\./, $need)) {
284+
for $n (split(/\./, $need), unpack("C*", $patch)) {
283285
$v = shift @v || 0;
284286
return 0 if $n > $v;
285287
return 1 if $v > $n;

0 commit comments

Comments
 (0)