Skip to content

Commit 6ef9481

Browse files
committed
added a test case to exercise a bug in ngx_proxy's ssl handshake timeout handling (see http://mailman.nginx.org/pipermail/nginx-devel/2014-July/005627.html ).
1 parent 8acc73f commit 6ef9481

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

t/014-bugs.t

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ log_level('debug');
99

1010
repeat_each(3);
1111

12-
plan tests => repeat_each() * (blocks() * 2 + 28);
12+
plan tests => repeat_each() * (blocks() * 2 + 30);
1313

1414
our $HtmlDir = html_dir;
1515
#warn $html_dir;
@@ -952,3 +952,42 @@ ok
952952
--- no_error_log
953953
[error]
954954
955+
956+
957+
=== TEST 41: https proxy has no timeout protection for ssl handshake
958+
--- http_config
959+
server {
960+
listen unix:$TEST_NGINX_HTML_DIR/nginx.sock ssl;
961+
ssl_certificate /tmp/test.crt;
962+
ssl_certificate_key /tmp/test.key;
963+
964+
location /foo {
965+
echo foo;
966+
}
967+
}
968+
969+
upstream local {
970+
server unix:$TEST_NGINX_HTML_DIR/nginx.sock;
971+
}
972+
973+
--- config
974+
location = /t {
975+
proxy_pass https://local/foo;
976+
}
977+
--- request
978+
GET /t
979+
980+
--- stap
981+
probe process("nginx").function("ngx_http_upstream_ssl_handshake") {
982+
printf("read timer set: %d\n", $c->read->timer_set)
983+
printf("write timer set: %d\n", $c->write->timer_set)
984+
}
985+
--- stap_out
986+
read timer set: 0
987+
write timer set: 1
988+
989+
--- response_body eval
990+
--- no_error_log
991+
[error]
992+
[alert]
993+

0 commit comments

Comments
 (0)