2015-10-07 21 views
2

我的web.xml中具有下列安全約束:如何在Wildfly 8.2中從http重定向到https?

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

此配置通過302個重定向重定向所有的HTTP URL爲https。除了通過Wildfly 8.2中的301重定向以外,還有其他方法可以實現嗎?

+0

我能想到的唯一的事情就是編輯承諾本身....不知道如何做到這一點,雖然。 – Brooks

+2

您確實需要定製['ServletExtension'](https://http2.undertow.io/documentation/servlet/servlet-extensions.html)。我現在只能從頭頂部看不到實現細節。 – BalusC

+0

@BalusC,我會看看這種方法。如果您能找到時間提供示例,我將不勝感激。在此之前我會繼續閱讀。 – k170

回答