本文介绍了WebSphere,sendRedirect和HTTPS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

环境:WebSphere App Server / WebSphere Portal 7,由IBM IHS / Apache httpd使用was_ap20_module / mod_was_ap20_http。

Environment: WebSphere App Server / WebSphere Portal 7, fronted by IBM IHS/Apache httpd using was_ap20_module / mod_was_ap20_http.

我有一个带有重定向的servlet或JSP页面喜欢

I have a servlet or JSP page with a redirect like

response.sendRedirect("/wps/myportal/....")

生成的HTTP最终会为IHS / Apache端点提供正确的主机和端口,但协议错误。它是http而不是https。

The generated HTTP ends up with the right host and port for the IHS/Apache endpoint but the wrong protocol. It is http instead of https.

例如,如果IHS / Apache正在侦听 https://myserver.com 和WAS在 http://192.168.12.34:12345 (所有端口/主机都是假的),然后我的重定向返回为 http: //myserver.com - 正确的主机和端口但协议错误。

For example, if IHS/Apache is listening on https://myserver.com and WAS is on http://192.168.12.34:12345 (all ports/hosts fake), then my redirect comes back as http://myserver.com - correct host and port but wrong protocol.

WebSphere如何确定要使用的主机/端口,但不是协议?如何强制执行所需的行为?

How does WebSphere figure out the right host/port to use but not the protocol? How can I force the desired behavior?

推荐答案

添加Apache mod_headers以在请求转发到websphere之前添加自定义标头, websphere,将httpsIndicatorHeader设置为该自定义标头,然后websphere将知道切换到https

Add Apache mod_headers to add a custom header before the request is forwarded to websphere, in websphere, set the httpsIndicatorHeader to that custom header, then websphere will know to switch to https

http://www.ibmconnections.org/wordpress/index.php/tag/was-ssl-http-https/
http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Frweb_custom_props.html

http://www.ibmconnections.org/wordpress/index.php/tag/was-ssl-http-https/http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Frweb_custom_props.html

这篇关于WebSphere,sendRedirect和HTTPS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 16:16