您的位置:首页 > 运维架构 > Tomcat

tomcat 配置 ssl

2016-12-07 17:49 253 查看

1.生成 SSL 证书

keytool -genkey -alias tomcat -keyalg RSA
Enter keystore password:  password
Re-enter new password: password
What is your first and last name?
[Unknown]:  Loiane Groner
What is the name of your organizational unit?
[Unknown]:  home
What is the name of your organization?
[Unknown]:  home
What is the name of your City or Locality?
[Unknown]:  Sao Paulo
What is the name of your State or Province?
[Unknown]:  SP
What is the two-letter country code for this unit?
[Unknown]:  BR
Is CN=Loiane Groner, OU=home, O=home, L=Sao Paulo, ST=SP, C=BR correct?
[no]:  y

Enter key password for
(RETURN if same as keystore password):  password
Re-enter new password: password


2.证书默认保存位置:

windows:C:\Users\Administrator

linux:

修改 tomcat conf/server.xml 配置文件

<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keyStoreFile="D:\.keystore" keystorePass="123456"
/>


3.启动 tomcat 访问你的项目就可以了:注意浏览器会提示不安全的网站,这个没事,只需要选择高级继续访问就行了

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  tomcat ssl