Estoy usando ksoap2-android para realizar una llamada al servicio wcf a través de SSL. Puedo hacer que funcione sin SSL, pero ahora quiero hacer la llamada a través de SSL, pero me he encontrado con algunos problemas.Certificado no confiable usando ksoap2-android
estoy usando el HttpsTransportSE en lugar de HttpTransportSE, pero estoy consiguiendo el error: javax.net.ssl.SSLException: No certificado de confianza
¿Cómo puedo solucionar este servidor?
¿Puedo agregar el certificado del servidor al almacén de claves en Android para resolver el problema?
private static final String SOAP_ACTION = "http://example.com/Service/GetInformation";
private static final String METHOD_NAME = "GetInformation";
private static final String NAMESPACE = "http://example.com";
private static final String URL = "dev.example.com/Service.svc";
public static Result GetInformation()
{
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
PropertyInfo property = new PropertyInfo();
property.name = "request";
Request request =
new Request("12", "13", "Ben");
userInformationProperty.setValue(request);
userInformationProperty.setType(request.getClass());
request.addProperty(property);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
envelope.addMapping(NAMESPACE, "Request",new Request().getClass());
HttpsTransportSE transport = new HttpsTransportSE(URL, 443, "", 1000);
//HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
transport.debug = true;
try
{
transport.call(SOAP_ACTION, envelope);
return Result.FromSoapResponse((SoapObject)envelope.getResponse());
}
catch (IOException e)
{
e.printStackTrace();
}
catch (XmlPullParserException e)
{
e.printStackTrace();
}
return null;
}
usando su primera solución es más o menos lo mismo que usar no ssl – Rafa