Skip to content

Commit 256a59c

Browse files
committed
added a test case for the previous commit.
1 parent 99866b5 commit 256a59c

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

t/129-ssl-socket.t

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use Test::Nginx::Socket::Lua;
44

55
repeat_each(2);
66

7-
plan tests => repeat_each() * (blocks() * 7);
7+
plan tests => repeat_each() * 219;
88

99
$ENV{TEST_NGINX_HTML_DIR} ||= html_dir();
1010

@@ -2584,3 +2584,37 @@ SSL reused session
25842584
[alert]
25852585
--- timeout: 5
25862586
2587+
2588+
2589+
=== TEST 32: handshake, too many arguments
2590+
--- config
2591+
server_tokens off;
2592+
resolver $TEST_NGINX_RESOLVER;
2593+
location /t {
2594+
#set $port 5000;
2595+
set $port $TEST_NGINX_MEMCACHED_PORT;
2596+
2597+
content_by_lua_block {
2598+
local sock = ngx.socket.tcp()
2599+
sock:settimeout(2000)
2600+
2601+
local ok, err = sock:connect("g.sregex.org", 443)
2602+
if not ok then
2603+
ngx.say("failed to connect: ", err)
2604+
return
2605+
end
2606+
2607+
ngx.say("connected: ", ok)
2608+
2609+
local session, err = sock.sslhandshake()
2610+
}
2611+
}
2612+
2613+
--- request
2614+
GET /t
2615+
--- ignore_response
2616+
--- error_log eval
2617+
qr/\[error\] .* ngx.socket connect: expecting 1 ~ 4 arguments \(including the object\), but seen 0/
2618+
--- no_error_log
2619+
[alert]
2620+
--- timeout: 5

0 commit comments

Comments
 (0)