Any reason to building a HTTP client from scratch? Why don't we use
existing libs such as HTTPClient or Netty?

On Fri, Dec 18, 2015 at 8:51 AM, Harsha Thirimanna <hars...@wso2.com> wrote:

> Just try to give absolute path first and test. Because as Dharshana
> mentioned, it should work.
>
>
> *Harsha Thirimanna*
> Senior Software Engineer; WSO2, Inc.; http://wso2.com
> * <http://www.apache.org/>*
> *email: **hars...@wso2.com* <az...@wso2.com>* cell: +94 71 5186770 *
> *twitter: **http://twitter.com/ <http://twitter.com/afkham_azeez>*
> *harshathirimannlinked-in: **http:
> <http://lk.linkedin.com/in/afkhamazeez>**//www.linkedin.com/pub/harsha-thirimanna/10/ab8/122
> <http://www.linkedin.com/pub/harsha-thirimanna/10/ab8/122>*
>
> *Lean . Enterprise . Middleware*
>
>
> On Thu, Dec 17, 2015 at 5:23 PM, Dharshana Warusavitharana <
> dharsha...@wso2.com> wrote:
>
>> Hi Malmee,
>>
>> You have to replace the cert location with actuvel .srt file you have.
>>
>> Thank you,
>> Dharshana
>>
>> On Thu, Dec 17, 2015 at 2:32 PM, Malmee Weerasinghe <mal...@wso2.com>
>> wrote:
>>
>>> Hi Dharshana,
>>> I tried with what you suggested. But I still get the same error.
>>> ppaas-artifact-converter tool doesn't run on Carbon and it runs
>>> independently. Therefore for "System.getProperty("carbon.home")" it
>>> returns null. I tried copying this file, "wso2carbon.jks" to the resources
>>> folder. But I get the same error.
>>> Thank you.
>>>
>>> On Thu, Dec 17, 2015 at 9:31 AM, Dharshana Warusavitharana <
>>> dharsha...@wso2.com> wrote:
>>>
>>>> Hi Malmee,
>>>>
>>>> The SSL issue comes with the rest client is because you are going to
>>>> invoke HTTPS backend with out proper certificate in path.
>>>>
>>>> you can set keys to the system path using following
>>>>
>>>> String trustStore = System.getProperty("carbon.home") + File.separator + 
>>>> "repository" + File.separator +
>>>>                     "resources" + File.separator + "security" + 
>>>> File.separator + "wso2carbon.jks";
>>>> System.setProperty("javax.net.ssl.trustStore", trustStore);
>>>> System.setProperty("javax.net.ssl.trustStorePassword", "wso2carbon");
>>>> System.setProperty("javax.net.ssl.trustStoreType", "JKS");
>>>>
>>>>
>>>> In this sample WSO2 carbon keys set as keys to the system path you can use 
>>>> the same.
>>>>
>>>> Apache HTTP client is bit old client instead you can try some thing like 
>>>> JAX-RS 2 or RestEasy client.
>>>>
>>>> In All these clients you need to add above code segment to export keys to 
>>>> call secured HTTP call.
>>>>
>>>>
>>>> Thank you,
>>>>
>>>> Dharshana.
>>>>
>>>>
>>>> On Wed, Dec 16, 2015 at 8:56 PM, Isuru Haththotuwa <isu...@wso2.com>
>>>> wrote:
>>>>
>>>>> Hi Malmee,
>>>>>
>>>>> If you have used java built in methods, that would mean your tool
>>>>> would not be required to depend on an external library such as Apache HTTP
>>>>> client as you have mentioned. This is fine for a simple use case. However,
>>>>> please note if you need more functionality, such as support for all HTTP
>>>>> operations, and other capabilities, etc. it would be advisable to use
>>>>> Apache HTTP client or any other suitable existing library without
>>>>> implementing it again by yourself.
>>>>>
>>>>> For the certificate issue that you are getting, its possible to
>>>>> override the default certificate validation mechanism and plug in your own
>>>>> implementation which can disable certificate validation (for testing
>>>>> purposes). For HTTP Client 4, please see [1].
>>>>>
>>>>> [1].
>>>>> http://stackoverflow.com/questions/2703161/how-to-ignore-ssl-certificate-errors-in-apache-httpclient-4-0
>>>>>
>>>>> On Wed, Dec 16, 2015 at 8:29 PM, Malmee Weerasinghe <mal...@wso2.com>
>>>>> wrote:
>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>> We have developed a HTTPS REST client using java in-built methods
>>>>>> which works properly. [1] This method is configured to allow self signed
>>>>>> certificates.
>>>>>>
>>>>>> When using apache http client we get a certificate error :
>>>>>> javax.net.ssl.SSLPeerUnverifiedException: Host name '192.168.30.227'
>>>>>> does not match the certificate subject provided by the peer 
>>>>>> (CN=localhost,
>>>>>> O=WSO2, L=Mountain View, ST=CA, C=US).
>>>>>>
>>>>>> What would be a good choice? Using apache HTTP client or java in
>>>>>> built methods. Your suggestions are highly appreciated.
>>>>>>
>>>>>> [1]
>>>>>> https://github.com/nishadi/product-private-paas/blob/master/tools/migration/ppaas-artifact-converter/src/main/java/org/wso2/ppaas/tools/artifactmigration/RestClient.java
>>>>>>
>>>>>> --
>>>>>> Malmee Weerasinghe
>>>>>> WSO2 Intern
>>>>>> mobile : (+94)* 71 7601905* |   email :   <dehan.vith...@aiesec.net>
>>>>>> mal...@wso2.com
>>>>>>
>>>>>> _______________________________________________
>>>>>> Dev mailing list
>>>>>> Dev@wso2.org
>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Thanks and Regards,
>>>>>
>>>>> Isuru H.
>>>>> +94 716 358 048* <http://wso2.com/>*
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Dev mailing list
>>>>> Dev@wso2.org
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Dharshana Warusavitharana
>>>> Senior Software Engineer , Test Automation
>>>> WSO2 Inc. http://wso2.com
>>>> email : dharsha...@wso2.com <dharsha...@wso2.com>
>>>> Tel  : +94 11 214 5345
>>>> Fax :+94 11 2145300
>>>> cell : +94770342233
>>>> blog : http://dharshanaw.blogspot.com
>>>>
>>>> lean . enterprise . middleware
>>>>
>>>
>>>
>>>
>>> --
>>> Malmee Weerasinghe
>>> WSO2 Intern
>>> mobile : (+94)* 71 7601905* |   email :   <dehan.vith...@aiesec.net>
>>> mal...@wso2.com
>>>
>>
>>
>>
>> --
>>
>> Dharshana Warusavitharana
>> Senior Software Engineer , Test Automation
>> WSO2 Inc. http://wso2.com
>> email : dharsha...@wso2.com <dharsha...@wso2.com>
>> Tel  : +94 11 214 5345
>> Fax :+94 11 2145300
>> cell : +94770342233
>> blog : http://dharshanaw.blogspot.com
>>
>> lean . enterprise . middleware
>>
>> _______________________________________________
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Kasun Indrasiri
Software Architect
WSO2, Inc.; http://wso2.com
lean.enterprise.middleware

cell: +94 77 556 5206
Blog : http://kasunpanorama.blogspot.com/
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to