I'm using KSOAP2 to call to a web service. At first, I tried to work it without any kind of security (only HTTP) and the result was a success. Now I've added SSL security to my Web Service (it runs on an Apache Axis2), but I can't connect from my Android app by using KSOAP2. I've been searching around and the only answers I can get are the ones who tell me that I should trust all untrusted certificates (create a fake trustmanager):
Not trusted certificate using ksoap2-android
And they paste always the same code:
private TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
public void checkServerTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
}
};
Which is not what I'm looking for. This answer, even if it works, it's just only a workaround and doesn't solve the problem, just avoids it. What I want to know is if there is a way where you can modify the Android cacerts and add my untrusted certificate or just do something in order to avoid the solution I've just talked about. I don't want to create a new trustmanager if it could be possible.