We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a41fdce commit fa5982cCopy full SHA for fa5982c
t/140-ssl-c-api.t
@@ -1229,10 +1229,14 @@ lua ssl server name: "test.com"
1229
ffi.cdef[[
1230
const char *SSL_get_servername(const void *, const int);
1231
]]
1232
- local libssl = ffi.load "ssl"
1233
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)
+ local sni = ffi.C.SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name)
+ if sni == nil then
+ ngx.log(ngx.ERR, "failed to get sni")
1236
+ return
1237
+ end
1238
+
1239
+ ngx.log(ngx.INFO, "SNI is ", ffi.string(sni))
1240
}
1241
1242
ssl_certificate ../../cert/test.crt;
0 commit comments