我在项目中使用 Grails (2.2.2),并且我的应用程序发出不需要的 http 重定向而不是 https 重定向。
目前,我们在 Oracle Weblogic 前面有一个 F5 负载均衡器。F5 正在从 Weblogic 卸载我们的 SSL。F5仅接受https请求,Weblogic仅接受http请求。
我的 Grails 项目使用 Spring Security 和 Spring Security CAS 插件。
该问题通常发生在成功登录 CAS 时。Grails 似乎总是发出 HTTP 重定向。
我的 serverURL 指定 HTTPS,就像我的所有 CAS 配置变量一样。喜欢
grails.serverURL = "https://example.com/${appName}"
Run Code Online (Sandbox Code Playgroud)
有没有办法强制 GRAILS/Weblogic 仅发出 https 重定向?
编辑 #1 - 更多信息
我尝试这样做但没有运气:
grails.plugin.springsecurity.secureChannel.useHeaderCheckChannelSecurity = true
grails.plugin.springsecurity.secureChannel.definition = [
'/**': 'REQUIRES_SECURE_CHANNEL'
]
grails.plugin.springsecurity.portMapper.httpPort = 80
grails.plugin.springsecurity.portMapper.httpsPort = 443
grails.plugin.springsecurity.secureChannel.secureHeaderName = 'WL-Proxy-SSL'
grails.plugin.springsecurity.secureChannel.secureHeaderValue = 'http'
grails.plugin.springsecurity.secureChannel.insecureHeaderName = 'WL-Proxy-SSL'
grails.plugin.springsecurity.secureChannel.insecureHeaderValue = 'https'
Run Code Online (Sandbox Code Playgroud)
另外,该行为似乎可能与 …