List of usage examples for android.net SSLCertificateSocketFactory setKeyManagers
public void setKeyManagers(KeyManager[] keyManagers)
From source file:com.android.beyondemail.SSLUtils.java
/** * Returns a {@link org.apache.http.conn.ssl.SSLSocketFactory SSLSocketFactory} for use with the * Apache HTTP stack./*from ww w . ja v a 2s. c o m*/ */ public static SSLSocketFactory getHttpSocketFactory(boolean insecure, KeyManager keyManager) { SSLCertificateSocketFactory underlying = getSSLSocketFactory(insecure); if (keyManager != null) { underlying.setKeyManagers(new KeyManager[] { keyManager }); } SSLSocketFactory wrapped = new SSLSocketFactory(underlying); if (insecure) { wrapped.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); } return wrapped; }
From source file:com.android.emailcommon.utility.SSLUtils.java
/** * Returns a {@link org.apache.http.conn.ssl.SSLSocketFactory SSLSocketFactory} for use with the * Apache HTTP stack./*from w w w . j av a 2s .c o m*/ */ public static SSLSocketFactory getHttpSocketFactory(Context context, HostAuth hostAuth, KeyManager keyManager, boolean insecure) { SSLCertificateSocketFactory underlying = getSSLSocketFactory(context, hostAuth, insecure); if (keyManager != null) { underlying.setKeyManagers(new KeyManager[] { keyManager }); } SSLSocketFactory wrapped = new SSLSocketFactory(underlying); if (insecure) { wrapped.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); } return wrapped; }