comparison access_log.t @ 1865:0e1865aa9b33

Tests: reworked http SSL tests to use IO::Socket::SSL. Relevant infrastructure is provided in Test::Nginx http() functions. This also ensures that SSL handshake and various read and write operations are guarded with timeouts. The ssl_sni_reneg.t test uses IO::Socket::SSL::_get_ssl_object() to access the Net::SSLeay object directly and trigger renegotation. While not exactly correct, this seems to be good enough for tests. Similarly, IO::Socket::SSL::_get_ssl_object() is used in ssl_stapling.t, since SSL_ocsp_staple_callback is called with the socket instead of the Net::SSLeay object. Similarly, IO::Socket::SSL::_get_ssl_object() is used in ssl_verify_client.t, since there seems to be no way to obtain CA list with IO::Socket::SSL. Notable change to http() request interface is that http_end() now closes the socket. This is to make sure that SSL connections are properly closed and SSL sessions are not removed from the IO::Socket::SSL session cache. This affected access_log.t, which was modified accordingly.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 18 May 2023 18:07:17 +0300
parents 7d133fc4619d
children
comparison
equal deleted inserted replaced
1864:46351d990aee 1865:0e1865aa9b33
159 http_get('/varlog?logname='); 159 http_get('/varlog?logname=');
160 http_get('/varlog?logname=0'); 160 http_get('/varlog?logname=0');
161 http_get('/varlog?logname=filename'); 161 http_get('/varlog?logname=filename');
162 162
163 my $s = http('', start => 1); 163 my $s = http('', start => 1);
164 http_get('/addr', socket => $s);
165 my $addr = $s->sockhost(); 164 my $addr = $s->sockhost();
166 my $port = $s->sockport(); 165 my $port = $s->sockport();
167 my $saddr = $s->peerhost(); 166 my $saddr = $s->peerhost();
168 my $sport = $s->peerport(); 167 my $sport = $s->peerport();
168 http_get('/addr', socket => $s);
169 169
170 http_get('/binary'); 170 http_get('/binary');
171 171
172 # /escape/"1 %1B%1C "?c=2 172 # /escape/"1 %1B%1C "?c=2
173 http_get('/escape/%221%20%1B%1C%20%22?c=2'); 173 http_get('/escape/%221%20%1B%1C%20%22?c=2');