Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
private Socket constructSSLSocket(Context context, String host, int port) {
AssetManager assetManager = context.getAssets();
InputStream keyStoreInputStream ="");
KeyStore trustStore = KeyStore.getInstance("BKS");
trustStore.load(keyStoreInputStream, "somepass".toCharArray());
SSLSocketFactory sslSocketFactory = new SSLSocketFactory(trustStore);
return sslSocketFactory.connectSocket(sslSocketFactory.createSocket(), host, port, null, 0, new BasicHttpParams());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.