Hi, I am trying to connect to a self-signed SSL web services. I found no post that could lend me to the solution on the mailing-list. Does anybody has a working code for that.
These are the approach I try with no success : 1. Use a self made FakeX509TrustManager that implements X509TrustManager and @Override the following method : public X509Certificate[] getAcceptedIssuers() { return _new X509Certificate[]{}; //null array } //in my code, I reinit the SSLContext try { context = SSLContext.getInstance("TLS"); context.init(null, new FakeX509TrustManager(), new SecureRandom()); } 2. The more complexe following method : http://en.wikibooks.org/wiki/Programming:WebObjects/Web_Services/How_to_Trust_Any_SSL_Certificate with the following change context = SSLContext.getInstance("SSL"); -> context = SSLContext.getInstance("TLS"); and in my code SSLUtilities.trustAllHostnames(); SSLUtilities.trustAllHttpsCertificates(); 3. the use of the apache common httpclient directly. ProtocolSocketFactory socketFactory = new EasySSLProtocolSocketFactory( ); Protocol https = new Protocol( "https", socketFactory, 443); Protocol.registerProtocol( "https", https ); - the code of K9 works by doing that because it use socket (sslContext.getSocketFactory().createSocket(); ) What class are really affected by method 1. and 2. ? - The part, I don't understand. Is why the "SSL" algorithm is not supported in SSLContext and only the TLS. Is it this the reason for those methods to fail ? - Is it possible to add a new certificate using the keytool. Does anybody has a working example of doing that ? The goal would be to use the ksoap2 implementation to read and communicate to a SSL (self-signed) web services that need, also, http authentification. Ksoap2 extend the ServiceConnection connection = getServiceConnection(); Thank you for your help, --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---