关于 AsyncHttpClient 使用https 证书的问题
小小乐宝 2017-03-15 07:37:14 有个p12的证书, 在okhttp下可以~ 但是在AsyncHttpClient 通信 返回SL handshake terminated
AsyncHttpClient 支持p12的证书吗?
关键 代码是这样的
KeyStore keyStore = KeyStore.getInstance("PKCS12");
InputStream instream = context.getResources().openRawResource(
R.raw.server);//后台拿到的.p12证书
keyStore.load(instream, "123456".toCharArray());
sslFactory = new MySSLSocketFactory(keyStore);
private static AsyncHttpClient client = new AsyncHttpClient();
client.setSSLSocketFactory(getSocketFactory(context));