EJBCA-CE环境中Swagger UI无法访问(404)问题咨询
问题:EJBCA容器中REST API正常但Swagger UI返回404错误
环境与问题现象
- PoC环境部署EJBCA QuickStart容器,管理面板可通过
https://localhost:8443/ejbca/adminweb/正常访问 - 尝试访问Swagger UI地址
https://localhost:8443/ejbca/swagger-ui时,出现404错误
已完成的配置验证
根据官方要求,Swagger UI仅在非生产模式(ejbca.properties中设置ejbca.productionmode=false)且REST协议启用时可用,已完成以下验证:
1. 非生产模式配置确认
pki@localhost:~$ docker exec -it ejbca bash bash-4.4$ cat ejbca/conf/ejbca.properties #appserver.home=/opt/wildfly ejbca.productionmode=false # Allow override from /etc/ejbca/conf/ allow.external-dynamic.configuration=true #------------------- EJBCA Healthcheck settings ------------- healthcheck.amountfreemem=16 healthcheck.dbquery=SELECT 1 FROM CertificateData WHERE fingerprint='XX' healthcheck.authorizedips=ANY healthcheck.catokensigntest=true healthcheck.publisherconnections=false healthcheck.maintenancefile=/etc/ejbca/conf/maintenance.properties healthcheck.maintenancepropertyname=DOWN_FOR_MAINTENANCE healthcheck.okmessage=ALLOK healthcheck.customerrormessage=EJBCANOTOK healthcheck.sendservererror=true #------------------- CLI settings ------------- ejbca.cli.defaultusername=ejbca ejbca.cli.defaultpassword=ejbca # By default, EJBCA keeps a list of every EJBCA instance's hostname that has started in this cluster # and allows for example Services to be pinned to a specific set of hostnames. # In environments that has many short-lived instances with different hostnames this should be disabled. # # Default: true ejbca.nodetracking=false bash-4.4$
2. REST API可用性验证
API v1和v2均已启用,使用合法证书密钥可正常调用:
toto@titi:~/PKI$ curl -k -X GET "https://localhost:8443/ejbca/ejbca-rest-api/v1/certificate/status" --cert api.crt --key api.key {"status":"OK","version":"1.0","revision":"EJBCA 8.0 Community (ce7f5e74b9a054edf61b188fa46f03e57b8478ab)"} toto@titi:~/PKI$ curl -k -X GET "https://localhost:8443/ejbca/ejbca-rest-api/v2/certificate/status" --cert api.crt --key api.key {"status":"OK","version":"2.0","revision":"EJBCA 8.0 Community (ce7f5e74b9a054edf61b188fa46f03e57b8478ab)"}
请求解决思路
REST API功能正常,但Swagger UI无法访问,求排查解决方向。
内容的提问来源于stack exchange,提问作者aureylz
相关产品推荐
相关产品推荐

