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.

Unable to extract the trust manager

See original GitHub issue

Hi, 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:closed
  • Created 8 years ago
  • Comments:72 (18 by maintainers)

github_iconTop GitHub Comments

17reactions
JeffreyCAcommented, Apr 6, 2017

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:

-keepclassmembers class * implements javax.net.ssl.SSLSocketFactory {
    private final javax.net.ssl.SSLSocketFactory delegate;
}

In my SocketFactory class, I had the following field:

private final SSLSocketFactory delegate;

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.

5reactions
pggcommented, Mar 30, 2016

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

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