We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba65f5a commit 9e66b37Copy full SHA for 9e66b37
lib/resty/core/socket/tcp.lua
@@ -48,12 +48,17 @@ local server_name_str = ffi.new("ngx_str_t[1]")
48
local openssl_error_code = ffi.new("int[1]")
49
50
local function setclientcert(self, cert, pkey)
51
- if not cert or not pkey then
+ if not cert and not pkey then
52
self.client_cert = nil
53
self.client_pkey = nil
54
return
55
end
56
57
+ if not cert or not pkey then
58
+ error("client certificate must be supplied with corresponding " ..
59
+ "private key", 2)
60
+ end
61
+
62
if type(cert) ~= "cdata" then
63
error("bad client cert type", 2)
64
0 commit comments