Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion apisix/schema_def.lua
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,12 @@ _M.ssl = {
client = {
type = "object",
properties = {
ca = certificate_scheme,
ca = {
oneOf = {
certificate_scheme,
secret_uri_schema
}
},
depth = {
type = "integer",
minimum = 0,
Expand Down
10 changes: 6 additions & 4 deletions apisix/ssl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,12 @@ function _M.check_ssl_conf(in_dp, conf)
if not support_client_verification() then
return nil, "client tls verify unsupported"
end

local ok, err = validate(conf.client.ca, nil)
if not ok then
return nil, "failed to validate client_cert: " .. err

if not secret.check_secret_uri(conf.client.ca) then
local ok, err = validate(conf.client.ca, nil)
if not ok then
return nil, "failed to validate client_cert: " .. err
end
end
end

Expand Down
6 changes: 3 additions & 3 deletions apisix/ssl/router/radixtree_sni.lua
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ function _M.set(matched_ssl, sni)
return false, err
end

if matched_ssl.value.client then
local ca_cert = matched_ssl.value.client.ca
local depth = matched_ssl.value.client.depth
if new_ssl_value.client then
local ca_cert = new_ssl_value.client.ca
local depth = new_ssl_value.client.depth
if apisix_ssl.support_client_verification() then
local parsed_cert, err = apisix_ssl.fetch_cert(sni, ca_cert)
if not parsed_cert then
Expand Down
Loading