我试图按照在Tomcat 7中为本地应用程序设置SSL的说明进行操作.我真的不明白我在这里做什么,所以请原谅我的方法.我创建了一个密钥库,如下所示:
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):
Run Code Online (Sandbox Code Playgroud)
然后我在我的server.xml中添加了一个Connector端口:
<Connector port="8443" maxThreads="200"
scheme="https" secure="true" SSLEnabled="true"
keystoreFile="${user.home}/.keystore" keystorePass="changeit"
clientAuth="false" sslProtocol="TLS"/>
Run Code Online (Sandbox Code Playgroud)
我出口证书:
keytool -export -alias tomcat -file tomcatcertfile.cer
Enter keystore password: changeit
Certificate stored in file <tomcatcertfile.cer>
Run Code Online (Sandbox Code Playgroud)
我重新启动了Tomcat.我在IE中加载我的应用程序https:// localhost:8443/blah/myapp.它显示证书错误.
我在地址栏中单击"证书错误">单击"查看证书">单击"安装证书">"下一步">勾选将所有证书放在以下存储中>单击"浏览">单击"受信任的根证书颁发机构">"下一步">"完成">"是">"确定">"确定" .
现在,当我进入页面时,我看到"本网站提供的安全证书是针对不同网站的地址发布的".
那么......我究竟做错了什么?
谢谢你的建议!
抢:)
| 归档时间: |
|
| 查看次数: |
8869 次 |
| 最近记录: |