SSL证书管理
SSL证书安装指南
Spring Boot上启用HTTPS
Tomcat服务器安装PFX格式证书
Tomcat服务器安装安装JKS格式证书
Apache服务器上安装SSL证书
Nginx或Tengine服务器上安装证书
GlassFish服务器上安装SSL证书
IIS服务器上安装SSL证书
Ubuntu系统Apache 2部署SSL证书
Jetty服务器上安装SSL证书
CentOS系统Tomcat 8.5或9上部署SSL证书
JBoss服务器上安装SSL证书
常见问题
证书安装配置出错或网站无法访问怎么办?
苹果ATS证书的选择及配置
谷歌浏览器无法访问安装SSL证书后的IIS服务
在IIS部署服务证书后访问资源出现404报错
终端的浏览器提示证书不可信的排查方法
Chrome浏览器出现“ERR_CERTIFICATE_TRANSPARENCY_REQUIRED”报错
如何转换证书格式?
为什么使用火狐浏览器访问已配置证书的网站提示不安全?
苹果ATS证书的选择及配置
如何设置证书的TLS协议版本?
如何在macOS系统安装根证书
下载根证书和中间证书
RSA 加密算法与 ECC 加密算法的区别?
用OpenSSL生成自签名证书在IIS上搭建Https站点
本文档使用 MrDoc 发布
-
+
首页
Jetty服务器上安装SSL证书
1. Jetty服务器版本确认。建议使用Jetty 9.2.22及以上版本。 2. 下载tomcat格式的证书。非系统生成的CSR需要生成pfx证书密匙对文件,转换命令如下。 >s openssl pkcs12 -export -out 214362464370691.pfx -inkey 214362464370691.key -in 214362464370691.pem 3. 转换pfx的证书密匙对文件为jks格式,转换命令如下: >i **说明** Windows环境注意在%JAVA_HOME%/jdk/bin目录中执行。 >s keytool -importkeystore -srckeystore 密匙对文件.pfx -destkeystore 证书名称.jks -srcstoretype PKCS12 -deststoretype JKS 回车后输入两次要设置的jks格式证书密码,然后输入一次pfx证书密码。三次密码必须输入pfx-password.txt记录的密码。jks密码与pfx证书密码相同,否则可能会导致Jetty服务器启动失败。 命令行执行:  4. 配置Jetty的SSL。 a. 确保Jetty的HTTP页面可正常访问。确认访问正常  b. 拷贝证书。进入Jetty服务器目录下的etc,新建存放jks格式证书的目录,并复制jks格式证书至当前目录。 ```bash # pwd /opt/jetty9222/etc # mkdir cert # cd cert/ # cp ../../../keys/jetty.jks . # ls jetty.jks ``` 命令行  c. 编辑Jetty服务器目录中的etc中的jetty-ssl.xml文件,设置证书相关参数(密码设置均为pfx-password.txt所记录的密码)。 jetty-ssl.xml文件  ```xml <?xml version="1.0"?> <Configure id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory"> <Set name="KeyStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.keystore" default="etc/cert/jetty.jks"/></Set> <Set name="KeyStorePassword"><Property name="jetty.keystore.password" default="214362464370691"/></Set> <Set name="KeyManagerPassword"><Property name="jetty.keymanager.password" default="214362464370691"/></Set> <Set name="TrustStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.truststore" default="etc/cert/jetty.jks"/></Set> <Set name="TrustStorePassword"><Property name="jetty.truststore.password" default="214362464370691"/></Set> <Set name="EndpointIdentificationAlgorithm"></Set> <Set name="NeedClientAuth"><Property name="jetty.ssl.needClientAuth" default="false"/></Set> <Set name="WantClientAuth"><Property name="jetty.ssl.wantClientAuth" default="false"/></Set> <Set name="ExcludeCipherSuites"> <Array type="String"> <Item>SSL_RSA_WITH_DES_CBC_SHA</Item> <Item>SSL_DHE_RSA_WITH_DES_CBC_SHA</Item> <Item>SSL_DHE_DSS_WITH_DES_CBC_SHA</Item> <Item>SSL_RSA_EXPORT_WITH_RC4_40_MD5</Item> <Item>SSL_RSA_EXPORT_WITH_DES40_CBC_SHA</Item> <Item>SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA</Item> <Item>SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA</Item> </Array> </Set> <New id="sslHttpConfig" class="org.eclipse.jetty.server.HttpConfiguration"> <Arg><Ref refid="httpConfig"/></Arg> <Call name="addCustomizer"> <Arg><New class="org.eclipse.jetty.server.SecureRequestCustomizer"/></Arg> </Call> </New> </Configure> ``` d. 编辑Jetty服务器目录中的etc中的jetty-https.xml文件,配置HTTPS所使用的443端口。 jetty-https.xml文件  ```xml <?xml version="1.0"?> <Call id="httpsConnector" name="addConnector"> <Arg> <New class="org.eclipse.jetty.server.ServerConnector"> <Arg name="server"><Ref refid="Server" /></Arg> <Arg name="acceptors" type="int"><Property name="ssl.acceptors" default="-1"/></Arg> <Arg name="selectors" type="int"><Property name="ssl.selectors" default="-1"/></Arg> <Arg name="factories"> <Array type="org.eclipse.jetty.server.ConnectionFactory"> <Item> <New class="org.eclipse.jetty.server.SslConnectionFactory"> <Arg name="next">http/1.1</Arg> <Arg name="sslContextFactory"><Ref refid="sslContextFactory"/></Arg> </New> </Item> <Item> <New class="org.eclipse.jetty.server.HttpConnectionFactory"> <Arg name="config"><Ref refid="sslHttpConfig"/></Arg> </New> </Item> </Array> </Arg> <Set name="host"><Property name="jetty.host" /></Set> <Set name="port"><Property name="https.port" default="443" /></Set> <Set name="idleTimeout"><Property name="https.timeout" default="30000"/></Set> <Set name="soLingerTime"><Property name="https.soLingerTime" default="-1"/></Set> <Set name="acceptorPriorityDelta"><Property name="ssl.acceptorPriorityDelta" default="0"/></Set> <Set name="selectorPriorityDelta"><Property name="ssl.selectorPriorityDelta" default="0"/></Set> <Set name="acceptQueueSize"><Property name="https.acceptQueueSize" default="0"/></Set> </New> </Arg> </Call> </Configure> ``` e. 编辑Jetty服务器目录中的start.ini文件,按需求更改端口号,并设置启动加载jetty-https.xml, >s jetty-ssl.xml。 jetty.port=80 jetty.dump.stop= etc/jetty-ssl.xml etc/jetty-https.xml 重启Jetty,验证HTTPS访问是否正常。 验证 
扫地僧
2023年3月22日 14:08
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
Markdown文件
分享
链接
类型
密码
更新密码