zoukankan      html  css  js  c++  java
  • tomcat配置https

    http访问tomcat默认端口是80,http://域名
    https访问tomcat 的端口是443,https://域名
    https访问tomcat的8443端口就相当于http访问tomcat的8080端口,需要在域名后面拼接端口号,http://域名:8080,https://域名:8443。

    server.xml配置如下。

    1、<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="443" />
    2、<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="C:/soft/tomcat.keystore" keystorePass="123456"/>
    3、<Connector port="8009" enableLookups="false" protocol="AJP/1.3" redirectPort="443" />
    上面的443是由原本的8443修改的,因为443(https)相当于80(http)的端口。其中2在http访问的下是被注释掉的,而在https才可以使用。

    web.xml的配置如下

    在web.xml文件的倒数第二行(</welcome-file-list>下面)添加如下配置。

    <login-config>
    <!-- Authorization setting for SSL -->

    <auth-method>CLIENT-CERT</auth-method>

    <realm-name>Client Cert Users-only Area</realm-name>
    </login-config>

    <security-constraint>
    <!-- Authorization setting for SSL -->

    <web-resource-collection >

    <web-resource-name >SSL</web-resource-name>

    <url-pattern>/*</url-pattern>
    </web-resource-collection>

    <user-data-constraint>

    <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
    </security-constraint>

    参考地址:https://www.cnblogs.com/luchangyou/p/6028067.html

  • 相关阅读:
    单元测试
    python gdb
    圣诞树
    网络是怎样连接的 读书笔记
    POJ2104 K-th Number(整体二分)
    [SDOI2011]消耗战
    [HNOI2011]XOR和路径
    [HNOI2013]游走
    [JSOI2008]球形空间产生器
    POJ2728 Desert King
  • 原文地址:https://www.cnblogs.com/ming-blogs/p/10288656.html
Copyright © 2011-2022 走看看