I am using a Swagger-generated client to call a REST service from within a webapp running on Liberty. The connection uses SSL but fails because the certificate is not found.
I switched on debugging and saw that the call accesses the JRE trust store and not the Liberty truststore in /opt/ibm/wlp/output/defaultServer/resources/security/key.jks
.
What confuses me more is that the same webapp calls SAP webservices (SOAP) which also require SSL. These work fine.
Why do the SOAP services find the certs but the REST calls look in the wrong place?
Update
This question seems to be related: HttpsUrlConnection using KeyStore instead of TrustStore with WebSphere Liberty Profile but I can't explain why the SOAP calls use the Liberty trust store and REST not.
Update
I'm now suspecting the OkHttp client used by swagger: https://github.com/swagger-api/swagger-codegen/issues/6413. The current version is 2.7.5. Will try upgrading to 3.9.0.