Search code examples
androidsoapsslksoap2

Android ksoap2 https connection


So I finally managed https connection with self-signed certificate on Android to work. But now I have maybe even bigger problem. I have a SOAP webservice on server and only option which I found on internet for using SOAP with Android, is utilize ksoap2 library. Problem is, that for https connection I am using a Apache HttpClient (org.apache.http.client.HttpClient) with added custom trust store. Ksoap2 itself has class HttpsTransportSE, but if I use this class I got an infamous error "no peer certificate". Is there any way to, let say, extend HttpsTransportSE and add certificate for connection?

Few other things comes to my head as well: Is there any other SOAP client which could be used on Android? How demanding is to actually write custom SOAP client? (As far as I know, SOAP communicates with XML, so it should be much of a problem to do a custom parser...or am I missing something?)

Thanks for any comments/answers!


Solution

  • If it is self signed then you can just bypass the Certificate check.

    Check this https://stackoverflow.com/a/3457454/893574
    It worked for me.