首页 > 其他分享 >tomcat添加TLSv1.2https证书访问

tomcat添加TLSv1.2https证书访问

时间:2023-01-04 10:11:07浏览次数:39  
标签:tomcat 证书 TLSv1.2 port 添加 https redirectPort

打开 conf 下的 server.xml,从中找到如下注释信息。 <!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 This connector uses the NIO implementation. The default SSLImplementation will depend on the presence of the APR/native library and the useOpenSSL attribute of the AprLifecycleListener. Either JSSE or OpenSSL style configuration may be used regardless of the SSLImplementation selected. JSSE style configuration is used below. --> 在这里添加 <!-- <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true"> <SSLHostConfig> <Certificate certificateKeystoreFile="conf/localhost-rsa.jks" type="RSA" /> </SSLHostConfig> </Connector> -->   添加代码如下

<Connector
port="443"
protocol="HTTP/1.1"
maxThreads="150"
SSLEnabled="true"
scheme="https"
secure="true"
clientAuth="false"
sslProtocol="TLS"
sslEnabledProtocols="TLSv1.2"
keystoreFile="/usr/local/tomcat9/cert2022/zhengshu.pfx"
keystorePass="password"
truststoreType="PKCS12"
/>

 

需要注意的是keystoreFile是证书绝对路径地址,keystorePass是密码

然后去掉原有http访问配置,或者注释掉下面几行

<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />

 

然后找到

<!-- Define an AJP 1.3 Connector on port 8009 -->
<!--
<Connector protocol="AJP/1.3"
address="::1"
port="8009"
redirectPort="8443" />
-->

修改为

<Connector protocol="AJP/1.3"
address="::1"
port="8009"
redirectPort="443" />

标签:tomcat,证书,TLSv1.2,port,添加,https,redirectPort
From: https://www.cnblogs.com/niway/p/17024080.html

相关文章

  • https的网站是不是必须让用户装数字证书
    https的网站是不是必须让用户装数字证书?1.如果用户不装,是否就不能够访问,或者说无法完成,比如交易这种操作。 2.浏览器识别到https网站的时候,是浏览器负责建立加密通道......
  • org.nutz.http.Http忽略https SSL证书验证
    访问的是一个httpsget请求,报错需要SSL证书验证,以下方法直接跳过booleancheck=Http.disableJvmHttpsCheck(); //忽略https的证书检查......
  • nginx+tomcat+redis完成session共享
    nginx安装redis安装准备两个tomcat,修改相应的端口 名称IP端口tomcat版本JDKtomcat110.10.49.2380807.0.401.7.0_25tomcat210.10.49.1580817.0.401.7.0_25 修改nginx.conf......
  • 【拓展】745- Windows Server 升级 HTTPS 实战
    趁着国庆假期,开发了个小程序,但需要服务器使用HTTPS协议,因此借这次机会,学着自己完成HTTPS升级工作。如有什么错误,欢迎指正!......
  • tomcat和Servlet的一些基础认识(今天两篇,手都打累了,头秃的第n天)
    Web相关概念回顾​ 1,软件架构:​ C/S:客户端/服务端​ B/S:浏览器/服务端​ 2,资源分类​ 静态资源:所有用户访问后,得到的结果是一样的,称为静态资源​ 静......
  • 爬虫笔记【1】如何爬取无HTTPS证书的网站?
      在爬虫过程中遇到很多网页都多多少少会存在证书过期的情况,那么证书过期后,该网站会被认定为不安全网站,那么怎么进行正常的数据爬取呢?  主要从爬虫过程中常遇到的三个......
  • git clone with multiple account(https)
    ifusemultipleaccountwhenrungitclone(httpsprotocol),wecanusebelowwaytousediffaccount,Gotowebportal,andgetthegitclonelinkunderhttps......
  • tomcat 日志切割
    修改前的tomcat都是将所有数据保存在一个日志文件catalina.out中,平时实验环境下没有什么问题,但是在生产环境中,由于数据量巨大,会导致日志查看困难,因此将日志通过某些方......
  • FetchError: request to https://registry.npmjs.org/swiper failed, reason: connect
    安装swiper插件时,报错,经过下边方法解决后,重新安装swiper,成功! FetchError:requesttohttps://registry.npmjs.org/swiperfailed,reason:connectECONNREFUSED127.0......
  • CentOS7部署tomcat10
    CentOS7部署tomcat10查看tomcat与jdk版本对应关系https://tomcat.apache.org/whichversion.html  一、先安装jdk 1.下载jdk    官网下载如有旧版本请先卸......