【问题标题】:Spring Security 3: Setting up tomcat 6 for SSLSpring Security 3:为 SSL 设置 tomcat 6
【发布时间】:2012-01-18 18:55:53
【问题描述】:

我正在尝试为 SSL 设置在 tomcat 6 上运行的 spring security 3。

我需要测试与 https 的安全连接,为此我在 tomcat 上成功配置了 SSL,然后从生成的密钥库中导出证书,但我的应用程序仍然没有运行。它将我重定向到端口 8443 上的 https 并说“此网页不可用”。

<intercept-url pattern="/login" access="isAnonymous()" requires-channel="https"/>

谁能告诉我我还需要做什么来测试登录页面的安全连接?

【问题讨论】:

    标签: ssl spring-mvc spring-security certificate tomcat6


    【解决方案1】:

    8443 是 Tomcat 实例的正确 HTTPS 端口吗?如果没有,您需要在 Spring Security 中的 http 元素中进行端口映射:

    <http>
        ...
        <port-mappings>
          <port-mapping http="9080" https="9443"/>
        </port-mappings>
    </http>
    

    【讨论】:

    • 是的 8443 是我的 tomcat 实例的 https 端口。
    【解决方案2】:
    1. 在 server.xml 中将 HTTP 端口更改为 80,将 HTTPS 端口更改为 433。
    2. 确保您的 Spring 上下文配置文件中没有任何端口映射。
    3. 重新启动 Tomcat。
    4. 将此答案标记为有用;)

    【讨论】:

      【解决方案3】:

      似乎您必须配置您的 TOMCAT 以使用 SSL(除了上面写的所有内容)

      看看here

      希望这会有所帮助...

      天啊

      【讨论】:

        猜你喜欢
        • 2011-08-27
        • 2020-02-05
        • 1970-01-01
        • 2018-02-22
        • 2014-11-27
        • 2016-05-30
        • 2016-06-29
        • 2015-12-29
        • 2012-02-02
        相关资源
        最近更新 更多