Note that there are some explanatory texts on larger screens.

plurals
  1. PODealing with pc12 keystore in android
    primarykey
    data
    text
    <p>I want to enable ssl in android.Android application is running on servlets which are hosted in tomcat.Tomcat is secured by apache web server at front-end.I have created keystore using open ssl.keystore is in pc12 format.</p> <p>i have created bks using portecle tool. I am using following code.Still ssl is not working.</p> <p>Source Code:</p> <pre><code> import android.content.Context; import org.apache.http.conn.ClientConnectionManager; import org.apache.http.conn.scheme.PlainSocketFactory; import org.apache.http.conn.scheme.Scheme; import org.apache.http.conn.scheme.SchemeRegistry; import org.apache.http.conn.ssl.SSLSocketFactory; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.impl.conn.SingleClientConnManager; import com.myclinicmyway.*; import java.io.InputStream; import java.security.KeyStore; public class MyHttpClient extends DefaultHttpClient { public final Context context; public MyHttpClient(Context context) { this.context = context; } @Override protected ClientConnectionManager createClientConnectionManager() { SchemeRegistry registry = new SchemeRegistry(); registry.register( new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)); registry.register(new Scheme("https", newSslSocketFactory(), 443)); return new SingleClientConnManager(getParams(), registry); }// end of client connection private SSLSocketFactory newSslSocketFactory() { try { KeyStore trusted = KeyStore.getInstance("BKS"); InputStream in = context.getResources().openRawResource(R.raw.docinbangalore); try { trusted.load(in, "docinbangalore".toCharArray()); } finally { in.close(); } return new SSLSocketFactory(trusted); } catch (Exception e) { throw new AssertionError(e); }// end of catch }// end of ssl socket }// end of class </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload