Mercurial > hg > nginx-tests
comparison ssl_certificate.t @ 1637:da52525f49d1
Tests: avoid ssl_certificate.t hang on SIGPIPE.
It could stuck in SSL shutdown after abrupt connection termination by nginx.
A similar change is applied to stream_ssl_certificate.t for consistency.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 29 Dec 2020 20:21:18 +0300 |
parents | fd440d324700 |
children | 74cffa9d4c43 |
comparison
equal
deleted
inserted
replaced
1636:2d371452658c | 1637:da52525f49d1 |
---|---|
196 ############################################################################### | 196 ############################################################################### |
197 | 197 |
198 sub get { | 198 sub get { |
199 my ($host, $port, $ctx) = @_; | 199 my ($host, $port, $ctx) = @_; |
200 my ($s, $ssl) = get_ssl_socket($host, $port, $ctx) or return; | 200 my ($s, $ssl) = get_ssl_socket($host, $port, $ctx) or return; |
201 | |
202 local $SIG{PIPE} = 'IGNORE'; | |
203 | |
201 Net::SSLeay::write($ssl, 'GET / HTTP/1.0' . CRLF . CRLF); | 204 Net::SSLeay::write($ssl, 'GET / HTTP/1.0' . CRLF . CRLF); |
202 my $r = Net::SSLeay::read($ssl); | 205 my $r = Net::SSLeay::read($ssl); |
203 Net::SSLeay::shutdown($ssl); | 206 Net::SSLeay::shutdown($ssl); |
204 $s->close(); | 207 $s->close(); |
205 return $r unless wantarray(); | 208 return $r unless wantarray(); |