You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by Håkon Sagehaug <Ha...@bccs.uib.no> on 2009/02/25 13:01:26 UTC

Problems using https and rampart

Hi

I'll try to rephrase my question since I've not got any replay on my last
one.

Is there normally any problems with using rampart in conjunction with a web
service running under https. I can call the web services using ws-policy and
rampart fine using http, but when calling using https I get timeout
exception. If I call a service not using ws-policy/rampart by https this
also works fine. I only use simple Username/password in my policy.

In my client code I've only got his for enabelig https on the client side

System.setProperty("javax.net.ssl.trustStore",
                "certs/client.jks");

        System.setProperty("javax.net.ssl.trustStorePassword",
"clientpassword");

Any tips??

cheers, Håkon

-- 
Håkon Sagehaug, Scientific Programmer
Parallab, Bergen Center for Computational Science (BCCS)
UNIFOB AS (University of Bergen Research Company)

Re: Problems using https and rampart

Posted by Nandana Mihindukulasooriya <na...@gmail.com>.
Hmm, strange. Can you post the complete client code ?

thanks,
nandana

On Wed, Feb 25, 2009 at 5:31 PM, Håkon Sagehaug
<Ha...@bccs.uib.no>wrote:

> Hi
>
> I'll try to rephrase my question since I've not got any replay on my last
> one.
>
> Is there normally any problems with using rampart in conjunction with a web
> service running under https. I can call the web services using ws-policy and
> rampart fine using http, but when calling using https I get timeout
> exception. If I call a service not using ws-policy/rampart by https this
> also works fine. I only use simple Username/password in my policy.
>
> In my client code I've only got his for enabelig https on the client side
>
> System.setProperty("javax.net.ssl.trustStore",
>                 "certs/client.jks");
>
>         System.setProperty("javax.net.ssl.trustStorePassword",
> "clientpassword");
>
> Any tips??
>
> cheers, Håkon
>
> --
> Håkon Sagehaug, Scientific Programmer
> Parallab, Bergen Center for Computational Science (BCCS)
> UNIFOB AS (University of Bergen Research Company)
>



-- 
Nandana Mihindukulasooriya
WSO2 inc.

http://nandana83.blogspot.com/
http://www.wso2.org

Re: Problems using https and rampart

Posted by Håkon Sagehaug <Ha...@bccs.uib.no>.
Hi,

I do it once in the init method for the servlet, so from the looks of it
it's only engaged once, when the servlet is first called. So I guess thats
okay

cheers, Håkon

2009/2/27 Dimuthu Leelarathne <di...@wso2.com>

> Hi,
>
> Since you are doing it inside a servlet, you have to be careful about the
> following aspect.
>
> When you create the ConfigurationContext, Axis2 will unpack the .mar files
> to a temp directory. So if you do this(i.e. creating the
> ConfigurationContext) for every call, then the the temp directory will keep
> growing. So the best practice is to create the ConfigurationContext once and
> reuse it.
>
>
> Thank you,
> Dimuthu
>
> Håkon Sagehaug wrote:
>
>> Hi
>>
>> Thanks for the tip, it did the trick.
>>
>> A side question, what would be the best way to engage modules like rampart
>> in a servlet? My set up, is a servlet that had uses a web service, the web
>> service client needs to engage rampart, now I engage it in the init method
>> of the servlet using the configuration context like this
>>
>>        ctx = ConfigurationContextFactory
>>                    .createConfigurationContextFromFileSystem(
>>                            "/repository",
>>                            null);
>>            ctx.getAxisConfiguration().engageModule("rampart");
>>
>> Is there a better way, with respect to performance eventually other
>> stuff??
>>
>> cheers, Håkon
>>
>> 2009/2/26 Dimuthu Leelarathne <di...@wso2.com>
>>
>>
>>
>>> Hi,
>>>
>>> I assume you are using the policy.xml from sample01.
>>>
>>> You have to uncomment the below line the the policy.xml to send over
>>> https.
>>>
>>> <!-- <sp:HttpsToken RequireClientCertificate="false"/> -->
>>>
>>> Thank you,
>>> Dimuthu
>>>
>>>
>>> Håkon Sagehaug wrote:
>>>
>>>
>>>
>>>> Hi
>>>>
>>>> I'll try to rephrase my question since I've not got any replay on my
>>>> last
>>>> one.
>>>>
>>>> Is there normally any problems with using rampart in conjunction with a
>>>> web service running under https. I can call the web services using
>>>> ws-policy
>>>> and rampart fine using http, but when calling using https I get timeout
>>>> exception. If I call a service not using ws-policy/rampart by https this
>>>> also works fine. I only use simple Username/password in my policy.
>>>>
>>>> In my client code I've only got his for enabelig https on the client
>>>> side
>>>>
>>>> System.setProperty("javax.net.ssl.trustStore",
>>>>               "certs/client.jks");
>>>>
>>>>       System.setProperty("javax.net.ssl.trustStorePassword",
>>>> "clientpassword");
>>>>
>>>> Any tips??
>>>>
>>>> cheers, Håkon
>>>>
>>>> --
>>>> Håkon Sagehaug, Scientific Programmer
>>>> Parallab, Bergen Center for Computational Science (BCCS)
>>>> UNIFOB AS (University of Bergen Research Company)
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>>
>
>


-- 
Håkon Sagehaug, Scientific Programmer
Parallab, Bergen Center for Computational Science (BCCS)
UNIFOB AS (University of Bergen Research Company)

Re: Problems using https and rampart

Posted by Dimuthu Leelarathne <di...@wso2.com>.
Hi,

Since you are doing it inside a servlet, you have to be careful about 
the following aspect.

When you create the ConfigurationContext, Axis2 will unpack the .mar 
files to a temp directory. So if you do this(i.e. creating the 
ConfigurationContext) for every call, then the the temp directory will 
keep growing. So the best practice is to create the ConfigurationContext 
once and reuse it.

Thank you,
Dimuthu

Håkon Sagehaug wrote:
> Hi
>
> Thanks for the tip, it did the trick.
>
> A side question, what would be the best way to engage modules like rampart
> in a servlet? My set up, is a servlet that had uses a web service, the web
> service client needs to engage rampart, now I engage it in the init method
> of the servlet using the configuration context like this
>
>         ctx = ConfigurationContextFactory
>                     .createConfigurationContextFromFileSystem(
>                             "/repository",
>                             null);
>             ctx.getAxisConfiguration().engageModule("rampart");
>
> Is there a better way, with respect to performance eventually other stuff??
>
> cheers, Håkon
>
> 2009/2/26 Dimuthu Leelarathne <di...@wso2.com>
>
>   
>> Hi,
>>
>> I assume you are using the policy.xml from sample01.
>>
>> You have to uncomment the below line the the policy.xml to send over https.
>>
>> <!-- <sp:HttpsToken RequireClientCertificate="false"/> -->
>>
>> Thank you,
>> Dimuthu
>>
>>
>> Håkon Sagehaug wrote:
>>
>>     
>>> Hi
>>>
>>> I'll try to rephrase my question since I've not got any replay on my last
>>> one.
>>>
>>> Is there normally any problems with using rampart in conjunction with a
>>> web service running under https. I can call the web services using ws-policy
>>> and rampart fine using http, but when calling using https I get timeout
>>> exception. If I call a service not using ws-policy/rampart by https this
>>> also works fine. I only use simple Username/password in my policy.
>>>
>>> In my client code I've only got his for enabelig https on the client side
>>>
>>> System.setProperty("javax.net.ssl.trustStore",
>>>                "certs/client.jks");
>>>
>>>        System.setProperty("javax.net.ssl.trustStorePassword",
>>> "clientpassword");
>>>
>>> Any tips??
>>>
>>> cheers, Håkon
>>>
>>> --
>>> Håkon Sagehaug, Scientific Programmer
>>> Parallab, Bergen Center for Computational Science (BCCS)
>>> UNIFOB AS (University of Bergen Research Company)
>>>
>>>       
>>     
>
>
>   


Re: Problems using https and rampart

Posted by Håkon Sagehaug <Ha...@bccs.uib.no>.
Hi

Thanks for the tip, it did the trick.

A side question, what would be the best way to engage modules like rampart
in a servlet? My set up, is a servlet that had uses a web service, the web
service client needs to engage rampart, now I engage it in the init method
of the servlet using the configuration context like this

        ctx = ConfigurationContextFactory
                    .createConfigurationContextFromFileSystem(
                            "/repository",
                            null);
            ctx.getAxisConfiguration().engageModule("rampart");

Is there a better way, with respect to performance eventually other stuff??

cheers, Håkon

2009/2/26 Dimuthu Leelarathne <di...@wso2.com>

> Hi,
>
> I assume you are using the policy.xml from sample01.
>
> You have to uncomment the below line the the policy.xml to send over https.
>
> <!-- <sp:HttpsToken RequireClientCertificate="false"/> -->
>
> Thank you,
> Dimuthu
>
>
> Håkon Sagehaug wrote:
>
>> Hi
>>
>> I'll try to rephrase my question since I've not got any replay on my last
>> one.
>>
>> Is there normally any problems with using rampart in conjunction with a
>> web service running under https. I can call the web services using ws-policy
>> and rampart fine using http, but when calling using https I get timeout
>> exception. If I call a service not using ws-policy/rampart by https this
>> also works fine. I only use simple Username/password in my policy.
>>
>> In my client code I've only got his for enabelig https on the client side
>>
>> System.setProperty("javax.net.ssl.trustStore",
>>                "certs/client.jks");
>>
>>        System.setProperty("javax.net.ssl.trustStorePassword",
>> "clientpassword");
>>
>> Any tips??
>>
>> cheers, Håkon
>>
>> --
>> Håkon Sagehaug, Scientific Programmer
>> Parallab, Bergen Center for Computational Science (BCCS)
>> UNIFOB AS (University of Bergen Research Company)
>>
>
>


-- 
Håkon Sagehaug, Scientific Programmer
Parallab, Bergen Center for Computational Science (BCCS)
UNIFOB AS (University of Bergen Research Company)

Re: Problems using https and rampart

Posted by Dimuthu Leelarathne <di...@wso2.com>.
Hi,

I assume you are using the policy.xml from sample01.

You have to uncomment the below line the the policy.xml to send over https.

<!-- <sp:HttpsToken RequireClientCertificate="false"/> -->

Thank you,
Dimuthu

Håkon Sagehaug wrote:
> Hi
>
> I'll try to rephrase my question since I've not got any replay on my 
> last one.
>
> Is there normally any problems with using rampart in conjunction with 
> a web service running under https. I can call the web services using 
> ws-policy and rampart fine using http, but when calling using https I 
> get timeout exception. If I call a service not using ws-policy/rampart 
> by https this also works fine. I only use simple Username/password in 
> my policy.
>
> In my client code I've only got his for enabelig https on the client side
>
> System.setProperty("javax.net.ssl.trustStore",
>                 "certs/client.jks");
>
>         System.setProperty("javax.net.ssl.trustStorePassword", 
> "clientpassword");
>
> Any tips??
>
> cheers, Håkon
>
> -- 
> Håkon Sagehaug, Scientific Programmer
> Parallab, Bergen Center for Computational Science (BCCS)
> UNIFOB AS (University of Bergen Research Company)