soulbird commented on code in PR #9247:
URL: https://github.com/apache/apisix/pull/9247#discussion_r1162380486
##########
apisix/ssl.lua:
##########
@@ -252,9 +253,14 @@ function _M.check_ssl_conf(in_dp, conf)
end
end
- local ok, err = validate(conf.cert, conf.key)
- if not ok then
- return nil, err
+ -- if the certificate or key uses a secret reference, we only verify it
when using it
+ if not secret.check_secret_uri(conf.cert) or
+ not secret.check_secret_uri(conf.key) then
+
+ local ok, err = validate(conf.cert, conf.key)
Review Comment:
The check_ssl_conf function is called in two places:
1. cp plane write configuration
2. The dp plane reads the configuration from the configuration center
When a cert or key is referenced by a secret, it is not verified for the
following reasons:
1. Do not do too many dynamic checks on the cp plane, which can simplify the
network topology
2. The dp plane will verify when using the cert and key
Therefore, it is only verified when neither the cert nor the key is a secret
reference
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]