Tomcat:java.io.IOException:キーストアが改ざんされたか、パスワードが間違っていました
問題
TomcatのSSLを設定しましたが、Tomcatサーバを起動しても例外はありません:
14 Disember 2010 4:18:31 PM org.apache.tomcat.util.net.jsse.JSSESocketFactory getStore SEVERE: Failed to load keystore type JKS with path c:\keystore due to Keystore was tampered with, or password was incorrect java.io.IOException: Keystore was tampered with, or password was incorrect at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:771) at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:38) at java.security.KeyStore.load(KeyStore.java:1185) //... at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: java.security.UnrecoverableKeyException: Password verification failed at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:769) ... 20 more
解決策
Tomcatの ”
<Connector>
“のパスワードは、キーストアに割り当てたパスワードと一致しません。
ファイル:$ Tomcat \ conf \ server.xml
//... <!-- Define a SSL HTTP/1.1 Connector on port 8443 This connector uses the JSSE configuration, when using APR, the connector should be using the OpenSSL style configuration described in the APR documentation --> <Connector port="8443"//... keystorePass="password here must same with your keystore's password"/> //...
これを修正するには、両方とも同じパスワードを使用していることを確認し、パスワードも大文字と小文字を区別します:)