пятница, 8 августа 2014 г., 6:50:37 UTC+2 пользователь develephant.net написал:
Hello,
nginx -v shows:
nginx version: openresty/1.7.3.1rc0
When I run this code from the tests
local sock = ngx.socket.tcp()
local ok, err = sock:connect("www.google.com", 443)
if not ok then
ngx.say("failed to connect: ", err)
return
end
ngx.say("connected: ", ok)
local sess, err = sock:sslhandshake()
if not sess then
ngx.say("failed to do SSL handshake: ", err)
return
end
ngx.say("ssl handshake: ", type(sess))
I am getting an error:
attempt to call method 'sslhandshake' (a nil value)
I dug around but I don't see anything obvious. Am I using the wrong version?
Thanks in advance.
Hello Agentzh
some code
[root@VKRT113 /home/fish/sites/nextstep]# cat ssl.lua
ngx.say(ngx.config.ngx_lua_version)
local sock = ngx.socket.tcp()
local ok, err = sock:connect("www.google.com", 443)
if not ok then
ngx.say("failed to connect: ", err)
return
end
ngx.say("connected: ", ok)
--local sess, err = sock:sslhandshake()
if not sess then
ngx.say("failed to do SSL handshake: ", err)
return
end
ngx.say("ssl handshake: ", type(sess))
i get output "9012
connected: 1
failed to do SSL handshake: nil"
if unrem --local sess, err = sock:sslhandshake()
i get 503 with log
"2014/09/01 18:39:03 [error] 61534#0: *988288 lua entry thread aborted: runtime error: /home/fish/sites/nextstep/ssl.lua:13: attempt to call method 'sslhandshake' (a nil value)
stack traceback:
coroutine 0:
/home/fish/sites/nextstep/ssl.lua: in function </home/fish/sites/nextstep/ssl.lua:1>, client: 192.168.10.1, server:"
can you test this?
thank you