Hello, there. I need to establish https connection with 
https://free.temafon.ru but I've got CertPathValidatorException on Android 
2.3 and below. What have I done.

 1. Grab all certs from https://free.temafon.ru with Firefox.
 2. Import certs in keystore in sequence from temefon certificate to root 
certificate.
 3. Init ssl context:
           
 

    final KeyStore keystore = KeyStore.getInstance("BKS");

            keystore.load(getResources().openRawResource(R.raw.temafon),
                        "W0d3Uoa5PkED".toCharArray());
            final TrustManager trustManager = new 
TemafonTrustManager(keystore);

            final SSLContext sslContext = SSLContext.getInstance("TLS");
            sslContext.init(null, new TrustManager[] { trustManager }, 
null);

            HttpsURLConnection.setDefaultSSLSocketFactory(sslContext
                    .getSocketFactory());
Here, I use custom 
TrustManager(http://blog.chariotsolutions.com/2013/01/https-with-client-certificates-on.html),
 
because server sends certs in wrong order.

This code works fine on Android 4.0, but failed on 2.3 with   
`java.security.cert.CertPathValidatorException: Trust anchor for 
certification path not found.` What I'm doing whrong?

I've created a test project, which can be found 
here(https://github.com/Drnkn/HttpsTest).

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to