【问题标题】:Wildfly 8.2.0 Doesn't redirect to httpsWildfly 8.2.0 不会重定向到 https
【发布时间】:2015-01-23 13:11:05
【问题描述】:

我已启用 https 更改standalone.xml,如下所示:

 <security-realms>

        <security-realm name="UndertowRealm">  
            <server-identities>  
                <ssl>  
                    <keystore path="./ed.keystore" relative-to="jboss.server.config.dir" keystore-password="secret" alias="ed" key-password="secret" />  
                </ssl>
            </server-identities>  
        </security-realm> 
        ...

和:

<subsystem xmlns="urn:jboss:domain:undertow:1.2">
        <buffer-cache name="default"/>
        <server name="default-server">
            <http-listener  name="default" socket-binding="http" redirect-socket="https" />
            <https-listener name="https"   socket-binding="https" security-realm="UndertowRealm" />

以下两个链接都有效:

第二个实际上是安全连接。

很遗憾,第一个链接没有重定向到 https 协议。

我错过了什么?

谢谢。

【问题讨论】:

    标签: wildfly wildfly-8


    【解决方案1】:

    确保将其添加到 web.xml 中

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

    这将允许重定向任何 URL。

    【讨论】:

    • 对不起,我忘了说,我的应用程序里有。谢了。
    • @Fabrizio 在这个问题stackoverflow.com/questions/27302201/… 中描述的 web.xml 文件中是否有任何其他安全约束?
    • 感谢您的帮助。我的应用程序中只有一个安全约束显然,清除浏览器上的所有缓存和 wildfly (data,tmp) 上的一些目录解决了这个问题。
    • 我已经尝试了上述所有步骤,但仍然无法重定向 http --> https
    • @PratikAnand 哪个版本?
    猜你喜欢
    • 2015-05-29
    • 2019-07-12
    • 2014-07-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-26
    • 2018-03-14
    • 2015-07-14
    相关资源
    最近更新 更多