Open YathendraPrasad opened 7 years ago
How do i update okhttp version from 2.7.5 to OkHttp3 (3.7.1) .
Let me know the quick fix or the workaround
The pom.mustache for Java okhttp-gson can be found in https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache
(I think the code also needs to be updated as well after upgrading to OkHttp3)
You can then use the customize template with the -t
option.
Of course, we would appreciate if you can contribute back the upgrade to OkHttp3 lib for Java okhttp-gson generator.
Thanks for the update wing. Currently we have added the below snippet code as workaround
com.ibm.mfp.adapters.sample.ApiClient apiAuthInstance = new com.ibm.mfp.adapters.sample.ApiClient();
OkHttpClient client = apiAuthInstance.getHttpClient();
client.setConnectionSpecs(Arrays.asList(new ConnectionSpec[]{new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS).allEnabledCipherSuites().build()}));
There exists some differences with respect to api`s in OkHttp and OkHttp3 , therefore code changes will be bit tricky for us atleast which might need thorough understanding.
It would be helpful if you could announce tentative release date for 2.3.0
It would be helpful if you could announce tentative release date for 2.3.0
Sorry I can't commit a date as we've pending works for Scala and JS clients before we can release 2.3.0
@YathendraPrasad what about using Java "retrofit2" API client instead?
retrofit2 has a dependency on com.squareup.okhttp3: https://mvnrepository.com/artifact/com.squareup.retrofit2/retrofit/2.1.0
@YathendraPrasad @wing328 were there any resolutions to this issue? We are facing failure with SSL handshake as well on liberty. Thanks!
This is root cause exception that happens for SSL calls only. Any help appreciated.
Caused by: java.io.EOFException
at okio.RealBufferedSource.require(RealBufferedSource.java:64) ~[okio-1.6.0.jar:?]
at okio.GzipSource.consumeHeader(GzipSource.java:114) ~[okio-1.6.0.jar:?]
at okio.GzipSource.read(GzipSource.java:73) ~[okio-1.6.0.jar:?]
at okio.Buffer.writeAll(Buffer.java:956) ~[okio-1.6.0.jar:?]
at okio.RealBufferedSource.readByteArray(RealBufferedSource.java:92) ~[okio-1.6.0.jar:?]
at com.squareup.okhttp.ResponseBody.bytes(ResponseBody.java:57) ~[okhttp-2.7.5.jar:?]
at com.squareup.okhttp.ResponseBody.string(ResponseBody.java:83) ~[
okhttp-2.7.5.jar:?]
at ca.acme.bizservice.client.xyzClient.invoker.ApiClient.handleResponse(ApiClient.java:920) ~[xyzClient-1.0-SNAPSHOT.jar:?]
... 108 more
@jeanabraham thanks for tagging me but I'm no longer involved in this project. I hope others will be able to help you out. Good luck.
Description
With Existing OkHttp Version (2.7.5) , SSL is failing in the IBM Latest Liberty Build Pack .
Swagger-codegen version
2.2.2
Related issues/PRs
https://github.com/watson-developer-cloud/java-sdk/issues/610
Suggest a fix/enhancement
Upgrading to latest version of OkHttp it OkHttp3 (3.7.1) will fix the issue . The changes should be done in the Java Client -> pom.mustache artifact