Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using OkHttpClient on Wildfly causing an exception

I'm using Retrofit 2.0.2 and OkHttp 3.2.0 to call Here Maps Rest API.

Running from a unit test, works perfectly, but when I try to run it on Wildfy, I get an exception:

Caused by: java.lang.IllegalStateException: Unable to extract the trust manager on okhttp3.internal.Platform@68a0a06f, sslSocketFactory is class sun.security.ssl.SSLSocketFactoryImpl
at okhttp3.OkHttpClient.<init>(OkHttpClient.java:187)
at okhttp3.OkHttpClient.<init>(OkHttpClient.java:151)

Can I solve this by modifying the configuration of Wildfly or is this a bug of OkHttp?

like image 537
szilagyif Avatar asked Jun 06 '26 06:06

szilagyif


1 Answers

I was facing a similar issue, looks this is a bug with the latest version of okhttp - 3.2.0 You can temporarily resolve it by downgrading your dependency to 3.0.1 Later migrate to a more stable version!

Maven dependency(Should solve) :

<dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>okhttp</artifactId>
      <version>3.0.1</version>
</dependency>
like image 115
kaulmonish Avatar answered Jun 07 '26 19:06

kaulmonish



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!