Skip to content

Commit fa5982c

Browse files
tests: t/140-ssl-c-api.t failed because got wrong libssl.so.
1 parent a41fdce commit fa5982c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

t/140-ssl-c-api.t

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,10 +1229,14 @@ lua ssl server name: "test.com"
12291229
ffi.cdef[[
12301230
const char *SSL_get_servername(const void *, const int);
12311231
]]
1232-
local libssl = ffi.load "ssl"
12331232
local TLSEXT_NAMETYPE_host_name = 0
1234-
local sni = ffi.string(libssl.SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name))
1235-
ngx.log(ngx.INFO, "SNI is ", sni)
1233+
local sni = ffi.C.SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name)
1234+
if sni == nil then
1235+
ngx.log(ngx.ERR, "failed to get sni")
1236+
return
1237+
end
1238+
1239+
ngx.log(ngx.INFO, "SNI is ", ffi.string(sni))
12361240
}
12371241
12381242
ssl_certificate ../../cert/test.crt;

0 commit comments

Comments
 (0)