0
点赞
收藏
分享

微信扫一扫

2023年亚太杯数学建模思路 - 复盘:光照强度计算的优化模型

北溟有渔夫 2023-11-17 阅读 35

首先前端,vue打包后生成了dist,使用tomcat作为静态服务器,在tomcat中使用jks格式配置https(不是jks可以不用往下看了):

  • 将文件拷贝到tomcat的conf目录,修改server.xml(注意修改jks和密码那里):
     <Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true">
        <SSLHostConfig>
            <Certificate certificateKeystoreFile="conf/cdc.com.jks" certificateKeystorePassword="602tsfe" type="RSA"/>
        </SSLHostConfig>
    </Connector>
  • 将下面加载web.xml最后面,不用修改任何东西:
<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>
  • springboot 配置https:
  • 首先将jks文件拷贝到classpath下(resources目录下)。
  • 然后在application.properties中添加:
# 配置https:
server.ssl.key-store=classpath:cd.com.jks
server.ssl.key-store-password=60fe
server.ssl.key-store-type=JKS
  • 然后配置http跳转https(请注意通过properties配置只能使用https或者http,不能同时使用https和http):
    算了不配了,能用就行。
举报

相关推荐

0 条评论