【问题标题】:Spring web and tomcat with https带有 https 的 Spring Web 和 tomcat
【发布时间】:2014-07-30 13:47:54
【问题描述】:

我有一个在 tomcat 中运行的 Web 应用程序,我希望它使用 HTTPS 而不是 HTTP。我创建了一个自签名证书,以便服务器可以在握手期间使用它进行身份验证。 问题是,我似乎无法让它在 https 中运行,虽然当我尝试访问 tomcat home 时,它​​在 https 上运行良好。

我已经配置了我的 server.xml

<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />




<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
               maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
               keystoreFile="c:\Users\keystore" 
               keystorePass="testing"
               clientAuth="false" sslProtocol="TLS" />

我正在使用弹簧网。我错过了什么? 谢谢

【问题讨论】:

    标签: java spring tomcat


    【解决方案1】:

    几个月前我遇到了类似的问题。尝试将此添加到您的 web.xml

    <security-constraint>
            <web-resource-collection>
                <web-resource-name>Project Name</web-resource-name>
                <url-pattern>/*</url-pattern>
            </web-resource-collection>
            <user-data-constraint>
                <transport-guarantee>CONFIDENTIAL</transport-guarantee>
            </user-data-constraint>
        </security-constraint>
    

    【讨论】:

    • 为什么?它有什么作用?我无法从你的回答中看出。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-07-23
    • 2012-03-11
    • 2016-04-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-09
    相关资源
    最近更新 更多