question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

why classnofound exception of TrustManagerImpl ?

See original GitHub issue

I try to use conscrypt for tls 1.3 and got this exception, why?

AndroidRuntime: java.lang.NoClassDefFoundError: org.conscrypt.TrustManagerImpl
AndroidRuntime: 	at org.conscrypt.TrustManagerFactoryImpl.engineGetTrustManagers(TrustManagerFactoryImpl.java:87)
AndroidRuntime: 	at javax.net.ssl.TrustManagerFactory.getTrustManagers(TrustManagerFactory.java:219)
AndroidRuntime: 	at okhttp3.internal.Util.platformTrustManager(Util.java:667)
AndroidRuntime: 	at okhttp3.OkHttpClient.<init>(OkHttpClient.java:257)
AndroidRuntime: 	at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1040)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
flooeycommented, Jan 11, 2019

Oh, yes, the TrustManager won’t work on platforms pre-24 because X509ExtendedTrustManager was only introduced in API 24, and that will manifest as a ClassNotFoundException (since a class it extends doesn’t exist). On pre-24 platforms, you should rely on the platform trust manager (in other words, don’t call provideTrustManager()).

0reactions
jonamirehcommented, Jan 10, 2019

I can repro this in a WIP project here: https://github.com/jamireh/Android-TLSv1.3/tree/explore/trust-manager. The issue isn’t present on API24+. (The master branch shows how to get the TLSv1.3 tests to pass without provideTrustManager() down to API 19)

However, I’d like to piggy back off this issue. it would still be a problem if you wanted to enable CT in your application as provideTrustManager() would then be required. I did unzip the AAR & its classes.dex to manually confirm that the TrustManagerImpl is there

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix ClassNotFoundException in Java - Rollbar
The Java ClassNotFoundException occurs when the JVM tries to load a class but does not find it in the classpath. Learn the three...
Read more >
Project: frida-android-unpinning-ssl - Frida CodeShare
console.log("[+] (Android 7+) TrustManagerImpl verifyChain() called. ... If we dont have a ClassNotFoundException exception, raise the.
Read more >
How do I resolve ClassNotFoundException? - Stack Overflow
When you get a ClassNotFoundException, it means the JVM has traversed the entire classpath and not found the class you've attempted to reference....
Read more >
ClassNotFoundException vs NoClassDefFoundError - Baeldung
Both ClassNotFoundException and NoClassDefFoundError occur when the JVM can not find a requested class on the classpath.
Read more >
How to Solve java.lang.ClassNotFoundException in Java?
ClassNotFoundException is a checked exception and occurs when the Java Virtual Machine (JVM) tries to load a particular class and the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found