我使用keytool创建了一个证书:
keytool -genkey -alias tomcat -keyalg RSA
我将其导出并导入到我的密钥库中:
keytool -export -alias tomcat name.crt
keytool -import -file name.crt
当我运行keytool -list时,我有两个条目:
tomcat, Sept 15, 2010, keyEntry,
Certificate fingerprint (MD5): ...
mykey, Sept 17, 2010, trustedCertEntry
Certificate fingerprint (MD5):...
请注意,两个条目的指纹是相同的。
我配置了我的server.xml文件指向我的.keystore文件。
<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
keystoreFile="${user.home}/.keystore" keystorePass="changeit"
clientAuth="false" sslProtocol="TLS" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="443" />
但是在我的Tomcat日志中,当我执行Java应用程序的某个操作时,会看到以下内容:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
...
sun.security.validator.ValidatorException: No trusted certificate found
还需要进行其他的配置吗?