我正在尝试按照 setting up SSL in Tomcat 7 的说明进行操作对于本地应用程序。我真的不明白我在这里做什么,所以请原谅我的方法的 n00biness。我创建了一个 keystore ,如下所示:
keytool -genkey -alias tomcat -keyalg RSA
Enter keystore password: changeit
Re-enter new password: changeit
What is your first and last name?
[Unknown]: Robert Bram
What is the name of your organizational unit?
[Unknown]: Developers
What is the name of your organization?
[Unknown]: MyBusiness
What is the name of your City or Locality?
[Unknown]: Melbourne
What is the name of your State or Province?
[Unknown]: Victoria
What is the two-letter country code for this unit?
[Unknown]: AU
Is CN=Robert Bram, OU=Developers, O=MyBusiness, L=Melbourne, ST=Victoria, C=AU correct?
[no]: yes
Enter key password for <tomcat>
(RETURN if same as keystore password):
然后我向我的 server.xml 添加了一个连接器端口:
<Connector port="8443" maxThreads="200"
scheme="https" secure="true" SSLEnabled="true"
keystoreFile="${user.home}/.keystore" keystorePass="changeit"
clientAuth="false" sslProtocol="TLS"/>
我导出了证书:
keytool -export -alias tomcat -file tomcatcertfile.cer
Enter keystore password: changeit
Certificate stored in file <tomcatcertfile.cer>
我重新启动了 Tomcat。我加载我的应用程序 https://localhost:8443/blah/myapp在 IE 中。它显示证书错误。
我单击地址栏中的“证书错误”> 单击“查看证书”> 单击“安装证书”>“下一步”> 勾选“将所有证书放入以下存储”> 单击“浏览”> 单击“受信任的根证书颁发机构”>“下一步”>“完成”>"is">好的 > 好的。
现在,当我转到该页面时,我看到“此网站提供的安全证书是为其他网站的地址颁发的”。
那么..我究竟做错了什么?
感谢您的任何建议!
罗布 :)
最佳答案
不要输入您的姓名,而是输入服务器的主机名。
关于Tomcat 7 中的 SSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7509700/