Mercurial > hg > nginx-tests
comparison ssl_certificate.t @ 1860:58951cf933e1
Tests: added has_feature() test for SSL libraries.
This makes it possible to further simplify various SSL tests. It also
avoids direct testing of the $t->{_configure_args} internal field, and
implements proper comparison of version numbers.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 18 May 2023 18:07:06 +0300 |
parents | 0351dee227a8 |
children | 0e1865aa9b33 |
comparison
equal
deleted
inserted
replaced
1859:5f46af4707e7 | 1860:58951cf933e1 |
---|---|
37 my $ssl = Net::SSLeay::new($ctx) or die; | 37 my $ssl = Net::SSLeay::new($ctx) or die; |
38 Net::SSLeay::set_tlsext_host_name($ssl, 'example.org') == 1 or die; | 38 Net::SSLeay::set_tlsext_host_name($ssl, 'example.org') == 1 or die; |
39 }; | 39 }; |
40 plan(skip_all => 'Net::SSLeay with OpenSSL SNI support required') if $@; | 40 plan(skip_all => 'Net::SSLeay with OpenSSL SNI support required') if $@; |
41 | 41 |
42 my $t = Test::Nginx->new()->has(qw/http http_ssl geo/) | 42 my $t = Test::Nginx->new()->has(qw/http http_ssl geo openssl:1.0.2/) |
43 ->has_daemon('openssl'); | 43 ->has_daemon('openssl'); |
44 | |
45 $t->{_configure_args} =~ /OpenSSL ([\d\.]+)/; | |
46 plan(skip_all => 'OpenSSL too old') unless defined $1 and $1 ge '1.0.2'; | |
47 | 44 |
48 $t->write_file_expand('nginx.conf', <<'EOF'); | 45 $t->write_file_expand('nginx.conf', <<'EOF'); |
49 | 46 |
50 %%TEST_GLOBALS%% | 47 %%TEST_GLOBALS%% |
51 | 48 |