Tomcat 8.5 server.xml - 为主机名 [_default_] 提供了多个 SSLHostConfig 元素.主机名必须是唯一的 [英] Tomcat 8.5 server.xml - Multiple SSLHostConfig elements were provided for the host name [_default_]. Host names must be unique
问题描述
我正在尝试使用 Tomcat 8.5 更改 server.xml 并在尝试启动 tomcat 时收到以下错误:
I am trying to change server.xml with Tomcat 8.5 and get the following error when trying to start tomcat:
09-Feb-2017 06:23:25.278 警告 [main] org.apache.catalina.startup.Catalina.load Catalina.start using conf/server.xml: Error at (135, 20) : 多个 SSLHostConfig 元素为主机名 [default] 提供.主机名必须是唯一的.
09-Feb-2017 06:23:25.278 WARNING [main] org.apache.catalina.startup.Catalina.load Catalina.start using conf/server.xml: Error at (135, 20) : Multiple SSLHostConfig elements were provided for the host name [default]. Host names must be unique.
相关 server.xml 代码:
Relevant server.xml code:
<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" >
<SSLHostConfig>
keystoreFile="/saswork/sasadmin/tomcat/certs/eccerts"
keystorePass="xxxxxxxx"
storepass="xxxxxxxx"
truststoreFile="/saswork/sasadmin/tomcat/certs/eccerts"
sslProtocol="TLS"
</SSLHostConfig>
对错误含义的建议表示赞赏,并欢迎提供解决方案的建议.
Advice appreciated on what the error means and suggestions on a solution welcome.
推荐答案
首先,您对于
的语法不正确.应该是:
First, your syntax is incorrect for <SSLHostConfig>
.
It should be:
<SSLHostConfig>
<Certificate ... />
</SSLHostConfig>
此外,我将 keystorePass
放在
中的运气要好得多.
Also, I've had much better luck putting keystorePass
inside of <Connector>
.
唯一对我来说没有失败的
是:
The only <Connector>
that works without failing for me is:
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
keystoreFile="keystore.jks" keyAlias="alias"
keystorePass="password"
clientAuth="false" sslProtocol="TLS" />
否则会出现这些 MultipleSSLHostConfig
元素错误.
Otherwise these MultipleSSLHostConfig
element errors occur.
这篇关于Tomcat 8.5 server.xml - 为主机名 [_default_] 提供了多个 SSLHostConfig 元素.主机名必须是唯一的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!