Search in sources :

Example 1 with OpenSSLContextImpl

use of com.android.org.conscrypt.OpenSSLContextImpl in project platform_frameworks_base by android.

the class SSLCertificateSocketFactory method makeSocketFactory.

private SSLSocketFactory makeSocketFactory(KeyManager[] keyManagers, TrustManager[] trustManagers) {
    try {
        OpenSSLContextImpl sslContext = OpenSSLContextImpl.getPreferred();
        sslContext.engineInit(keyManagers, trustManagers, null);
        sslContext.engineGetClientSessionContext().setPersistentCache(mSessionCache);
        return sslContext.engineGetSocketFactory();
    } catch (KeyManagementException e) {
        Log.wtf(TAG, e);
        // Fallback
        return (SSLSocketFactory) SSLSocketFactory.getDefault();
    }
}
Also used : OpenSSLContextImpl(com.android.org.conscrypt.OpenSSLContextImpl) KeyManagementException(java.security.KeyManagementException)

Example 2 with OpenSSLContextImpl

use of com.android.org.conscrypt.OpenSSLContextImpl in project android_frameworks_base by AOSPA.

the class SSLCertificateSocketFactory method makeSocketFactory.

private SSLSocketFactory makeSocketFactory(KeyManager[] keyManagers, TrustManager[] trustManagers) {
    try {
        OpenSSLContextImpl sslContext = OpenSSLContextImpl.getPreferred();
        sslContext.engineInit(keyManagers, trustManagers, null);
        sslContext.engineGetClientSessionContext().setPersistentCache(mSessionCache);
        return sslContext.engineGetSocketFactory();
    } catch (KeyManagementException e) {
        Log.wtf(TAG, e);
        // Fallback
        return (SSLSocketFactory) SSLSocketFactory.getDefault();
    }
}
Also used : OpenSSLContextImpl(com.android.org.conscrypt.OpenSSLContextImpl) KeyManagementException(java.security.KeyManagementException)

Example 3 with OpenSSLContextImpl

use of com.android.org.conscrypt.OpenSSLContextImpl in project android_frameworks_base by crdroidandroid.

the class SSLCertificateSocketFactory method makeSocketFactory.

private SSLSocketFactory makeSocketFactory(KeyManager[] keyManagers, TrustManager[] trustManagers) {
    try {
        OpenSSLContextImpl sslContext = OpenSSLContextImpl.getPreferred();
        sslContext.engineInit(keyManagers, trustManagers, null);
        sslContext.engineGetClientSessionContext().setPersistentCache(mSessionCache);
        return sslContext.engineGetSocketFactory();
    } catch (KeyManagementException e) {
        Log.wtf(TAG, e);
        // Fallback
        return (SSLSocketFactory) SSLSocketFactory.getDefault();
    }
}
Also used : OpenSSLContextImpl(com.android.org.conscrypt.OpenSSLContextImpl) KeyManagementException(java.security.KeyManagementException)

Example 4 with OpenSSLContextImpl

use of com.android.org.conscrypt.OpenSSLContextImpl in project android_frameworks_base by DirtyUnicorns.

the class SSLCertificateSocketFactory method makeSocketFactory.

private SSLSocketFactory makeSocketFactory(KeyManager[] keyManagers, TrustManager[] trustManagers) {
    try {
        OpenSSLContextImpl sslContext = OpenSSLContextImpl.getPreferred();
        sslContext.engineInit(keyManagers, trustManagers, null);
        sslContext.engineGetClientSessionContext().setPersistentCache(mSessionCache);
        return sslContext.engineGetSocketFactory();
    } catch (KeyManagementException e) {
        Log.wtf(TAG, e);
        // Fallback
        return (SSLSocketFactory) SSLSocketFactory.getDefault();
    }
}
Also used : OpenSSLContextImpl(com.android.org.conscrypt.OpenSSLContextImpl) KeyManagementException(java.security.KeyManagementException)

Example 5 with OpenSSLContextImpl

use of com.android.org.conscrypt.OpenSSLContextImpl in project android_frameworks_base by ResurrectionRemix.

the class SSLCertificateSocketFactory method makeSocketFactory.

private SSLSocketFactory makeSocketFactory(KeyManager[] keyManagers, TrustManager[] trustManagers) {
    try {
        OpenSSLContextImpl sslContext = OpenSSLContextImpl.getPreferred();
        sslContext.engineInit(keyManagers, trustManagers, null);
        sslContext.engineGetClientSessionContext().setPersistentCache(mSessionCache);
        return sslContext.engineGetSocketFactory();
    } catch (KeyManagementException e) {
        Log.wtf(TAG, e);
        // Fallback
        return (SSLSocketFactory) SSLSocketFactory.getDefault();
    }
}
Also used : OpenSSLContextImpl(com.android.org.conscrypt.OpenSSLContextImpl) KeyManagementException(java.security.KeyManagementException)

Aggregations

OpenSSLContextImpl (com.android.org.conscrypt.OpenSSLContextImpl)6 KeyManagementException (java.security.KeyManagementException)6 SSLClientSessionCache (com.android.org.conscrypt.SSLClientSessionCache)1 IOException (java.io.IOException)1 X509Certificate (java.security.cert.X509Certificate)1 TrustManager (javax.net.ssl.TrustManager)1 X509TrustManager (javax.net.ssl.X509TrustManager)1