You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by vijayaratha vijayasingam <vi...@yahoo.co.uk> on 2011/08/31 10:51:03 UTC

Synapvise does not forward requests via proxyserver for a 'https' endpoint

Hi all;

Synapse is not working when we configure 'http' proxy to talk to 'https' endpoint via a proxyserver.
At axis2.xml, transport sender configuration, i have added proxy server configuration,with the additional two parameters..


<parameter locked="false" name="http.proxyHost">10.100.1.162</parameter>
<parameter locked="false" name="http.proxyPort">443</parameter>            //https port number
 <parameter name="HostnameVerifier">AllowAll</parameter>

Anyway, this configuration is not picked by synapse @  HttpCoreNIOSender class, since the condition is like,
if (sslContext == null) {
 proxyHost =
 proxyPort =

}

if we remove (sslContext==null) condition then both scenarios(http/https sender) work fine..But I'm not sure how this will affect other scenarios..

Please advice me on how this should  be fixed?

These are my configuration looks..

Proxy;
 <proxy name="TestProxy" transports="http" startOnLoad="true" trace="disable">
        <target>
            <inSequence>
                <send>
                    <endpoint>
                        <address uri="https://localhost:9444/services/SimpleStockQuoteService"/>
                    </endpoint>
                </send>
            </inSequence>
            <outSequence>
                <send/>
            </outSequence>
        </target>
    </proxy>

And my axis2.xml transport sender configured as; (i added two parameters http.proxyHost, http.proxyPort with the http/https ports of proxyserver..)

 <transportSender name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSender">
        <parameter name="non-blocking" locked="false">true</parameter>
            <parameter locked="false" name="http.proxyHost">10.100.1.162</parameter>
    <parameter locked="false" name="http.proxyPort">80</parameter>
    </transportSender>
    <transportSender name="https" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSSLSender">
        <parameter name="non-blocking" locked="false">true</parameter>
        <parameter name="keystore" locked="false">
            <KeyStore>
                <Location>repository/resources/security/wso2carbon.jks</Location>
                <Type>JKS</Type>
                <Password>wso2carbon</Password>
                <KeyPassword>wso2carbon</KeyPassword>
            </KeyStore>
        </parameter>
        <parameter name="truststore" locked="false">
            <TrustStore>
                <Location>repository/resources/security/client-truststore.jks</Location>
                <Type>JKS</Type>
                <Password>wso2carbon</Password>
            </TrustStore>
        </parameter>
    <parameter locked="false" name="http.proxyHost">10.100.1.162</parameter>
    <parameter locked="false" name="http.proxyPort">443</parameter>
    <parameter name="HostnameVerifier">AllowAll</parameter>
     </transportSender>

Thanks
-Ratha

Re: Synapvise does not forward requests via proxyserver for a 'https' endpoint

Posted by vijayaratha vijayasingam <vi...@yahoo.co.uk>.
Hi all;
Can anybody suggest a way to fix this issue?

Thanks
-Ratha



________________________________
 From: vijayaratha vijayasingam <vi...@yahoo.co.uk>
To: synapse-dev <de...@synapse.apache.org> 
Sent: Wednesday, 31 August 2011, 14:21
Subject: Synapvise does not forward requests via proxyserver for a 'https' endpoint
 

Hi all;

Synapse is not working when we configure 'http' proxy to talk to 'https' endpoint via a proxyserver.
At axis2.xml, transport sender configuration, i have added proxy server configuration,with the additional two parameters..


<parameter locked="false" name="http.proxyHost">10.100.1.162</parameter>
<parameter locked="false" name="http.proxyPort">443</parameter>            //https port number
 <parameter name="HostnameVerifier">AllowAll</parameter>

Anyway, this configuration is not picked by synapse @  HttpCoreNIOSender class, since the condition is like,
if (sslContext == null) {
 proxyHost =
 proxyPort =

}

if we remove (sslContext==null) condition then both scenarios(http/https sender) work fine..But I'm not sure how this will affect other scenarios..

Please advice me on how this should  be fixed?

These are my configuration looks..

Proxy;
 <proxy name="TestProxy" transports="http" startOnLoad="true" trace="disable">
        <target>
            <inSequence>
                <send>
                   
 <endpoint>
                        <address uri="https://localhost:9444/services/SimpleStockQuoteService"/>
                    </endpoint>
                </send>
            </inSequence>
            <outSequence>
                <send/>
            </outSequence>
        </target>
   
 </proxy>

And my axis2.xml transport sender configured as; (i added two parameters http.proxyHost, http.proxyPort with the http/https ports of proxyserver..)

 <transportSender name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSender">
        <parameter name="non-blocking" locked="false">true</parameter>
            <parameter locked="false" name="http.proxyHost">10.100.1.162</parameter>
    <parameter locked="false" name="http.proxyPort">80</parameter>
    </transportSender>
    <transportSender name="https" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSSLSender">
        <parameter name="non-blocking"
 locked="false">true</parameter>
        <parameter name="keystore" locked="false">
            <KeyStore>
                <Location>repository/resources/security/wso2carbon.jks</Location>
                <Type>JKS</Type>
                <Password>wso2carbon</Password>
                <KeyPassword>wso2carbon</KeyPassword>
            </KeyStore>
       
 </parameter>
        <parameter name="truststore" locked="false">
            <TrustStore>
                <Location>repository/resources/security/client-truststore.jks</Location>
                <Type>JKS</Type>
                <Password>wso2carbon</Password>
            </TrustStore>
        </parameter>
    <parameter locked="false" name="http.proxyHost">10.100.1.162</parameter>
    <parameter locked="false"
 name="http.proxyPort">443</parameter>
    <parameter name="HostnameVerifier">AllowAll</parameter>
     </transportSender>

Thanks
-Ratha

Re: Synapvise does not forward requests via proxyserver for a 'https' endpoint

Posted by vijayaratha vijayasingam <vi...@yahoo.co.uk>.
Hi hiranya,
I tested my proposed solution and it works fine to me...Not sure about the side effects...
Thanks
-Ratha



________________________________
 From: Hiranya Jayathilaka <hi...@gmail.com>
To: dev@synapse.apache.org; vijayaratha vijayasingam <vi...@yahoo.co.uk> 
Sent: Monday, 28 November 2011, 12:48
Subject: Re: Synapvise does not forward requests via proxyserver for a 'https' endpoint
 

Hi Ratha,

Can you get your scenario to work with the fix you have suggested? If so then we can seriously consider it as a viable solution.

Thanks,
Hiranya


On Wed, Aug 31, 2011 at 2:21 PM, vijayaratha vijayasingam <vi...@yahoo.co.uk> wrote:

Hi all;
>
>
>Synapse is not working when we configure 'http' proxy to talk to 'https' endpoint via a proxyserver.
>At axis2.xml, transport sender configuration, i have added proxy server configuration,with the additional two parameters..
>
>
>
><parameter locked="false" name="http.proxyHost">10.100.1.162</parameter>
><parameter locked="false" name="http.proxyPort">443</parameter>            //https port number
> <parameter name="HostnameVerifier">AllowAll</parameter>
>
>
>Anyway, this configuration is not picked by synapse @  HttpCoreNIOSender class, since the condition is like,
>if (sslContext == null) {
> proxyHost =
> proxyPort =
>
>}
>
>
>if we remove (sslContext==null) condition then both scenarios(http/https sender) work fine..But I'm not sure how this will affect other scenarios..
>
>
>Please advice me on how this should  be fixed?
>
>These are my configuration looks..
>
>
>Proxy;
> <proxy name="TestProxy" transports="http" startOnLoad="true" trace="disable">
>        <target>
>            <inSequence>
>                <send>
>                   
 <endpoint>
>                        <address uri="https://localhost:9444/services/SimpleStockQuoteService"/>
>                    </endpoint>
>                </send>
>            </inSequence>
>            <outSequence>
>                <send/>
>            </outSequence>
>        </target>
>   
 </proxy>
>
>
>And my axis2.xml transport sender configured as; (i added two parameters http.proxyHost, http.proxyPort with the http/https ports of proxyserver..)
>
>
> <transportSender name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSender">
>        <parameter name="non-blocking" locked="false">true</parameter>
>            <parameter locked="false" name="http.proxyHost">10.100.1.162</parameter>
>    <parameter locked="false" name="http.proxyPort">80</parameter>
>    </transportSender>
>    <transportSender name="https" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSSLSender">
>        <parameter name="non-blocking"
 locked="false">true</parameter>
>        <parameter name="keystore" locked="false">
>            <KeyStore>
>                <Location>repository/resources/security/wso2carbon.jks</Location>
>                <Type>JKS</Type>
>                <Password>wso2carbon</Password>
>                <KeyPassword>wso2carbon</KeyPassword>
>            </KeyStore>
>       
 </parameter>
>        <parameter name="truststore" locked="false">
>            <TrustStore>
>                <Location>repository/resources/security/client-truststore.jks</Location>
>                <Type>JKS</Type>
>                <Password>wso2carbon</Password>
>            </TrustStore>
>        </parameter>
>    <parameter locked="false" name="http.proxyHost">10.100.1.162</parameter>
>    <parameter locked="false"
 name="http.proxyPort">443</parameter>
>    <parameter name="HostnameVerifier">AllowAll</parameter>
>     </transportSender>
>
>
>Thanks
>-Ratha
>


-- 
Hiranya Jayathilaka
Associate Technical Lead;
WSO2 Inc.;  http://wso2.org
E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com

Re: Synapvise does not forward requests via proxyserver for a 'https' endpoint

Posted by Hiranya Jayathilaka <hi...@gmail.com>.
Hi Ratha,

Can you get your scenario to work with the fix you have suggested? If so
then we can seriously consider it as a viable solution.

Thanks,
Hiranya

On Wed, Aug 31, 2011 at 2:21 PM, vijayaratha vijayasingam <
vijayaratha@yahoo.co.uk> wrote:

> Hi all;
>
> Synapse is not working when we configure 'http' proxy to talk to 'https'
> endpoint via a proxyserver.
> At axis2.xml, transport sender configuration, i have added proxy server
> configuration,with the additional two parameters..
>
> <parameter locked="false" name="http.proxyHost">10.100.1.162</parameter>
> <parameter locked="false" name="http.proxyPort">443</parameter>
> //https port number
>  <parameter name="HostnameVerifier">AllowAll</parameter>
>
> Anyway, this configuration is not picked by synapse @  HttpCoreNIOSender
> class, since the condition is like,
> if (sslContext == null) {
>  proxyHost =
>  proxyPort =
> }
>
> if we remove (sslContext==null) condition then both scenarios(http/https
> sender) work fine..But I'm not sure how this will affect other scenarios..
>
> Please advice me on how this should  be fixed?
>
> These are my configuration looks..
>
> Proxy;
>  <proxy name="TestProxy" transports="http" startOnLoad="true"
> trace="disable">
>         <target>
>             <inSequence>
>                 <send>
>                     <endpoint>
>                         <address uri="
> https://localhost:9444/services/SimpleStockQuoteService"/>
>                     </endpoint>
>                 </send>
>             </inSequence>
>             <outSequence>
>                 <send/>
>             </outSequence>
>         </target>
>     </proxy>
>
> And my axis2.xml transport sender configured as; (i added two parameters
> http.proxyHost, http.proxyPort with the http/https ports of proxyserver..)
>
>  <transportSender name="http"
> class="org.apache.synapse.transport.nhttp.HttpCoreNIOSender">
>         <parameter name="non-blocking" locked="false">true</parameter>
>             <parameter locked="false"
> name="http.proxyHost">10.100.1.162</parameter>
>     <parameter locked="false" name="http.proxyPort">80</parameter>
>     </transportSender>
>     <transportSender name="https"
> class="org.apache.synapse.transport.nhttp.HttpCoreNIOSSLSender">
>         <parameter name="non-blocking" locked="false">true</parameter>
>         <parameter name="keystore" locked="false">
>             <KeyStore>
>
> <Location>repository/resources/security/wso2carbon.jks</Location>
>                 <Type>JKS</Type>
>                 <Password>wso2carbon</Password>
>                 <KeyPassword>wso2carbon</KeyPassword>
>             </KeyStore>
>         </parameter>
>         <parameter name="truststore" locked="false">
>             <TrustStore>
>
> <Location>repository/resources/security/client-truststore.jks</Location>
>                 <Type>JKS</Type>
>                 <Password>wso2carbon</Password>
>             </TrustStore>
>         </parameter>
>     <parameter locked="false"
> name="http.proxyHost">10.100.1.162</parameter>
>     <parameter locked="false" name="http.proxyPort">443</parameter>
>     <parameter name="HostnameVerifier">AllowAll</parameter>
>      </transportSender>
>
> Thanks
> -Ratha
>



-- 
Hiranya Jayathilaka
Associate Technical Lead;
WSO2 Inc.;  http://wso2.org
E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com