更新时间:2023-11-08 11:57:22
I have refer this page to configure https (SSL ) for my local tomcat or tomcat in my eclipse.
After doing 3 steps mention above link, When i am trying to start my server I got below Exception during startup:
SEVERE: Failed to initialize end point associated with ProtocolHandler [http-bi o-8443] java.io.IOException: Cannot recover key at org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:54
4)
因为它与以下异常有关:
Because it related with below exception :
java.io.IOException: Keystore was tampered with, or password was incorrect at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:772)
问题是当我尝试更改server.xml时,我没有在keystorePass
和keyPass
上提供正确的密码值,如下所示.
当我使用以下命令生成密钥库时,我已输入 changeit 作为密钥库的密码.但是当我在server.xml文件中配置https时,我提供了不同的密码.
Problem is when i try to change server.xml i did not supply correct password value on keystorePass
and keyPass
as below.
When i am generating keystore using below command I have entered changeit as password for keystore. But when i am configuring in server.xml file for https i was supplying different password.
命令:$Tomcat\bin>keytool -genkey -alias mkyong -keyalg RSA -keystore c:\mkyongkeystore
我有这个
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="c:\mkyongkeystore"
keystorePass="password" />
我更改为
<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="conf/srccodes.jks"
keystoreType="JKS"
keystorePass="changeit"
keyPass="changeit" />
对我有用.