Revolyssup commented on code in PR #11993:
URL: https://github.com/apache/apisix/pull/11993#discussion_r1982758750
##########
apisix/cli/ops.lua:
##########
@@ -503,38 +501,27 @@ Please modify "admin_key" in conf/config.yaml .
yaml_conf.apisix.ssl.listen = ssl_listen
yaml_conf.apisix.enable_http3_in_server_context =
enable_http3_in_server_context
-
- if yaml_conf.apisix.ssl.ssl_trusted_certificate ~= nil then
- local cert_paths = {}
- local ssl_certificates = yaml_conf.apisix.ssl.ssl_trusted_certificate
- for cert_path in string.gmatch(ssl_certificates, '([^,]+)') do
- cert_path = util.trim(cert_path)
- if cert_path == "system" then
- local trusted_certs_path, err =
util.get_system_trusted_certs_filepath()
- if not trusted_certs_path then
- util.die(err)
- end
- table.insert(cert_paths, trusted_certs_path)
- else
- -- During validation, the path is relative to PWD
- -- When Nginx starts, the path is relative to conf
- -- Therefore we need to check the absolute version instead
- cert_path = pl_path.abspath(cert_path)
- if not pl_path.exists(cert_path) then
- util.die("certificate path", cert_path, "doesn't exist\n")
- end
-
- table.insert(cert_paths, cert_path)
- end
+ if not yaml_conf.apisix.ssl.ssl_trusted_certificate then
+ yaml_conf.apisix.ssl.ssl_trusted_certificate = "system"
+ end
+ if yaml_conf.apisix.ssl.ssl_trusted_certificate == "system" then
+ local trusted_certs_path, err =
util.get_system_trusted_certs_filepath()
+ if not trusted_certs_path then
+ util.die(err)
end
-
- local combined_cert_filepath =
yaml_conf.apisix.ssl.ssl_trusted_combined_path
- or
"/usr/local/apisix/conf/ssl_trusted_combined.pem"
- util.gen_trusted_certs_combined_file(combined_cert_filepath,
cert_paths)
-
- yaml_conf.apisix.ssl.ssl_trusted_certificate = combined_cert_filepath
+ yaml_conf.apisix.ssl.ssl_trusted_certificate = trusted_certs_path
+ elseif yaml_conf.apisix.ssl.ssl_trusted_certificate ~= nil then
Review Comment:
fixed
--
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]