Unable to extract the trust manager
See original GitHub issueHi, after upgrading from OkHttp 3.0.1 to 3.1.0 I get the following stack trace and crash after calling build() to create a OkHttpClient.
java.lang.IllegalStateException: Unable to extract the trust manager on okhttp3.internal.Platform$Android@1d8cf999, sslSocketFactory is class com.google.android.gms.org.conscrypt.KitKatPlatformOpenSSLSocketAdapterFactory
at okhttp3.OkHttpClient.<init>(OkHttpClient.java:187)
at okhttp3.OkHttpClient.<init>(OkHttpClient.java:60)
at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:719)
This issue was not present in 3.0.1.
Here’s where the crash happens:
OkHttpClient.Builder builder = new OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS)
.writeTimeout(10, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS);
OkHttpClient client = builder.build();
Issue Analytics
- State:
- Created 8 years ago
- Comments:72 (18 by maintainers)
Top Results From Across the Web
java.lang.IllegalStateException: Unable to extract the trust ...
Caused by: java.lang.IllegalStateException: Unable to extract the trust manager on Android10Platform, sslSocketFactory is class com.android.org.conscrypt.
Read more >java.lang.IllegalStateException: Unable to extract the trust ...
The exception I got this: java.lang.IllegalStateException: Unable to extract the trust manager on AndroidPlatform, sslSocketFactory is class org ...
Read more >Unable to extract the trust manager on okhttp3.internal ... - Bugs
Summary: java. lang. IllegalStateException: Unable to extract the trust manager on okhtt... Add an attachment (proposed patch, testcase, etc.)
Read more >Unable to extract the trust manager on Android10Platform ...
Unable to extract the trust manager on Android10Platform 网上有大致有两种解决方案,但都不靠谱。产生这个异常的根本原因是: builder.
Read more >okhttp3.internal.platform.Platform.trustManager java ... - Tabnine
... X509TrustManager trustManager = trustManager(sslSocketFactory); if (trustManager == null) { throw new IllegalStateException("Unable to extract the trust ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I experienced this error while using a custom
SocketFactory
. I realized I didn’t add all the necessary ProGuard rules. I added the following to fix the issue:In my SocketFactory class, I had the following field:
So adjust the ProGuard rule accordingly. E.g, the access modifiers like
private
,final
, etc. as well as the field name (delegate
) should match exactly as written in the class file.Wildfly 10, java8, and any version > 3.0.1: Unable to extract the trust manager on okhttp3.internal.Platform@10c89bdf, sslSocketFactory is class sun.security.ssl.SSLSocketFactoryImpl