Mercurial > hg > nginx-tests
diff ssl_ocsp.t @ 1846:9d98c2ad3126
Tests: cleaned up ssl_ocsp.t.
Fixed verbose logging, added $SIG{PIPE} handling to avoid hangs if
the server closes connection, fixed SKIP message for BoringSSL.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 23 Mar 2023 19:50:24 +0300 |
parents | 5ac6efbe5552 |
children | a9704b9ed7a2 |
line wrap: on
line diff
--- a/ssl_ocsp.t Thu Mar 23 19:50:23 2023 +0300 +++ b/ssl_ocsp.t Thu Mar 23 19:50:24 2023 +0300 @@ -43,7 +43,8 @@ my $t = Test::Nginx->new()->has(qw/http http_ssl sni/)->has_daemon('openssl'); -plan(skip_all => 'no OCSP stapling') if $t->has_module('BoringSSL'); +plan(skip_all => 'no OCSP support in BoringSSL') + if $t->has_module('BoringSSL'); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -416,9 +417,11 @@ my $cipher = Net::SSLeay::get_cipher($ssl); Test::Nginx::log_core('||', "cipher: $cipher"); my $host = $extra{sni} ? $extra{sni} : 'localhost'; + local $SIG{PIPE} = 'IGNORE'; + log_out("GET /serial HTTP/1.0\nHost: $host\n\n"); Net::SSLeay::write($ssl, "GET /serial HTTP/1.0\nHost: $host\n\n"); my $r = Net::SSLeay::read($ssl); - Test::Nginx::log_core($r); + log_in($r); $s->close(); return $r unless wantarray(); return ($s, $ssl); @@ -496,6 +499,7 @@ my $resp; while (<$client>) { + Test::Nginx::log_core('||', $_); $headers .= $_; last if (/^\x0d?\x0a?$/); }