- 工信部备案号 滇ICP备05000110号-1
- 滇公安备案 滇53010302000111
- 增值电信业务经营许可证 B1.B2-20181647、滇B1.B2-20190004
- 云南互联网协会理事单位
- 安全联盟认证网站身份V标记
- 域名注册服务机构许可:滇D3-20230001
- 代理域名注册服务机构:新网数码
创建证书
keytool -genkeypair -alias "tomcat" -keyalg "RSA" -keystore "localhost-rsa.jks"
后面的信息随便输入,我这里输入的是:
Enter keystore password:
Re-enter new password:
What is your first and last name?
[Unknown]: pich
What is the name of your organizational unit?
[Unknown]: pich
What is the name of your organization?
[Unknown]: tomcat
What is the name of your City or Locality?
[Unknown]: beijing
What is the name of your State or Province?
[Unknown]: beijing
What is the two-letter country code for this unit?
[Unknown]: cn
Is CN=pich, OU=pich, O=tomcat, L=beijing, ST=beijing, C=cn correct?
[no]: y
Enter key password for <tomcat>
(RETURN if same as keystore password):
Re-enter new password:
这样就会在当前目录创建一个localhost-rsa.jks文件。密码是123456,别名是tomcat。
给Tomcat配置证书
首先将上面生成的localhost-rsa.jks文件拷贝到Tomcat的conf目录,然后打开该目录下面的server.xml文件,找到如下代码,原来是注释了,现在需要打开注释更改为如下内容:
然后重新启动Tomcat,访问https://www.landui.com:8443/
就可以看到如下页面:
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
SSLEnabled="true" maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="conf/localhost-rsa.jks" keystorePass="123456"
/>
可以看到地址栏是显示为不安全的。因为这个证书是我们自己制作的,浏览器默认不信任他,当然你可以手动信任他。
售前咨询
售后咨询
备案咨询
二维码
TOP