appmattus / certificatetransparency

Certificate transparency for Android and JVM
Apache License 2.0
146 stars 29 forks source link

Crashing on Android 6 : Not a supported type of X509TrustManager #38

Closed chetan-housing closed 1 year ago

chetan-housing commented 2 years ago

Application is crashing on Android 6 with this log :

  java.lang.IllegalArgumentException: tm is an instance of com.appmattus.certificatetransparency.internal.verifier.CertificateTransparencyTrustManager which is not a supported type of X509TrustManager
        at android.net.http.X509TrustManagerExtensions.<init>(X509TrustManagerExtensions.java:50)
        at com.appmattus.certificatetransparency.chaincleaner.AndroidCertificateChainCleaner$Factory.get(SourceFile:2)
        at com.appmattus.certificatetransparency.chaincleaner.AndroidCertificateChainCleaner$Factory.get(SourceFile:1)
        at com.appmattus.certificatetransparency.chaincleaner.CertificateChainCleaner$Companion.get(SourceFile:1)
        at com.appmattus.certificatetransparency.internal.verifier.CertificateTransparencyBase$cleaner$2.invoke(SourceFile:8)
        at com.appmattus.certificatetransparency.internal.verifier.CertificateTransparencyBase$cleaner$2.invoke(SourceFile:1)
        at wi.p.getValue(SourceFile:5)
        at com.appmattus.certificatetransparency.internal.verifier.CertificateTransparencyBase.getCleaner(SourceFile:1)
        at com.appmattus.certificatetransparency.internal.verifier.CertificateTransparencyBase.verifyCertificateTransparency(SourceFile:5)
        at com.appmattus.certificatetransparency.internal.verifier.CertificateTransparencyInterceptor.intercept(SourceFile:5)
        at okhttp3.internal.http.RealInterceptorChain.proceed(SourceFile:12)
        at k6.b.intercept(SourceFile:2)
        at okhttp3.internal.http.RealInterceptorChain.proceed(SourceFile:12)
        at okhttp3.internal.connection.ConnectInterceptor.intercept(SourceFile:4)
        at okhttp3.internal.http.RealInterceptorChain.proceed(SourceFile:12)
        at okhttp3.internal.cache.CacheInterceptor.intercept(SourceFile:27)
        at okhttp3.internal.http.RealInterceptorChain.proceed(SourceFile:12)
        at okhttp3.internal.http.BridgeInterceptor.intercept(SourceFile:22)
        at okhttp3.internal.http.RealInterceptorChain.proceed(SourceFile:12)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(SourceFile:7)
        at okhttp3.internal.http.RealInterceptorChain.proceed(SourceFile:12)
        at okhttp3.logging.HttpLoggingInterceptor.intercept(SourceFile:4)
        at okhttp3.internal.http.RealInterceptorChain.proceed(SourceFile:12)
        at lg.b.intercept(SourceFile:1)
        at okhttp3.internal.http.RealInterceptorChain.proceed(SourceFile:12)
        at lg.a.intercept(SourceFile:1)
        at okhttp3.internal.http.RealInterceptorChain.proceed(SourceFile:12)
        at lg.c.intercept(SourceFile:12)
        at okhttp3.internal.http.RealInterceptorChain.proceed(SourceFile:12)
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(SourceFile:16)
        at okhttp3.internal.connection.RealCall$AsyncCall.run(SourceFile:6)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
        at java.lang.Thread.run(Thread.java:818)
mattmook commented 2 years ago

this looks as though you are applying certificate transparency twice. by any chance are you using the new installCertificateTransparencyProvider - if so make sure to remove any certificate transparency OkHttp interceptors.