简体   繁体   中英

HTTPS URLs redirection in ProxySerlvlet

We are using proxy-1.0.2.jar in our application and need to POST xml payload to the redirected URL. When we do a redirect to HTTPS URL it's not working. But other HTTP or static IP address is working fine. Do we need to do any extra configuration for HTTPS URL in proxy filter?

Sample urls:

https url - https://abc.com/request/listing (not working)
http url - http://xx.xx.xx.xx:8080/request/listing (working)

In web.xml, we have the following entries:

<servlet-mapping>
    <servlet-name>listingProxyServlet</servlet-name>
    <url-pattern>/proxy/listing</url-pattern>
</servlet-mapping>

<servlet>
    <servlet-name>listingProxyServlet</servlet-name>
    <servlet-class>com.woonoz.proxy.servlet.ProxyServlet</servlet-class>
    <init-param>
        <param-name>target-url</param-name>
        <param-value>https://abc.com/request/listing</param-value>
    </init-param>
</servlet>

I found one solution and posting here. it may helpful for others

I have used HTTP proxy servlet ver. 2.6 and it's working fine

http://www.servletsuite.com/servlets/httpproxy.htm

<servlet>
                <servlet-name>accertifyListingProxyServlet</servlet-name>
                <servlet-class>com.jsos.httpproxy.HttpProxyServlet</servlet-class>
                <init-param>
                        <param-name>host</param-name>
                        <param-value>https://abc.com/order</param-value>
                </init-param>
                <init-param>
                        <param-name>headers</param-name>
                        <param-value>true</param-value>
                </init-param>
                <init-param>
                        <param-name>encoding</param-name>
                        <param-value>utf-8</param-value>
                </init-param>
        </servlet>

Regards, Sourabh

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM