Search in sources :

Example 1 with Conscrypt

use of org.conscrypt.Conscrypt in project android by nextcloud.

the class MainApp method insertConscrypt.

private void insertConscrypt() {
    Security.insertProviderAt(Conscrypt.newProvider(), 1);
    try {
        Conscrypt.Version version = Conscrypt.version();
        Log_OC.i(TAG, "Using Conscrypt/" + version.major() + DOT + version.minor() + DOT + version.patch() + " for TLS");
        SSLEngine engine = SSLContext.getDefault().createSSLEngine();
        Log_OC.i(TAG, "Enabled protocols: " + Arrays.toString(engine.getEnabledProtocols()) + " }");
        Log_OC.i(TAG, "Enabled ciphers: " + Arrays.toString(engine.getEnabledCipherSuites()) + " }");
    } catch (NoSuchAlgorithmException e) {
        Log_OC.e(TAG, e.getMessage());
    }
}
Also used : Conscrypt(org.conscrypt.Conscrypt) SSLEngine(javax.net.ssl.SSLEngine) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException)

Aggregations

NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 SSLEngine (javax.net.ssl.SSLEngine)1 Conscrypt (org.conscrypt.Conscrypt)1