【问题标题】:Spring security https authenticationSpring 安全 https 认证
【发布时间】:2015-03-21 07:37:49
【问题描述】:

我正在使用 spring security 3.2.5 和 Tomcat 7。当我尝试进入需要身份验证的页面(在远程服务器上通过 https)时,我没有重定向到默认的 spring security 登录表单。

我的 security.xml:

<security:intercept-url pattern="/**"
            access="isAuthenticated()" requires-channel="https"/>

        <security:port-mappings>
            <!-- Default ports -->
            <security:port-mapping http="8080" https="443" />
        </security:port-mappings>

我得到的错误:

Google Chrome's connection attempt to X.X.XXX.42 was rejected. The website may be down, or your network may not be properly configured.ERR_CONNECTION_REFUSED

我尝试按照本教程进行操作:Link

块引用

【问题讨论】:

  • 您是否在 server.xml 中启用了 https 连接器? 443端口是否在防火墙中打开?
  • 是的。 https 工作重定向不
  • 可以通过http访问登录页面吗?
  • 不,我正在使用负载均衡器,但如果我直接尝试使用 tomcat 是的

标签: java spring spring-mvc tomcat spring-security


【解决方案1】:

您说(在 cmets 中)您可以使用 HTTPS直接 访问登录页面,但是当您尝试 通过负载平衡器 时,您遇到了错误。

我相信你不仅要配置 tomcat 来使用 HTTPS,还要配置负载均衡器。如果您使用 F5,this link 可能会有所帮助。

(作为旁注,这个问题的标签应该从“spring security”更改为“load balancer”等......)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-10-30
    • 2016-12-12
    • 1970-01-01
    • 2021-05-17
    • 1970-01-01
    • 2018-09-07
    • 2021-01-17
    • 2011-11-17
    相关资源
    最近更新 更多