Apache HTTPClient and Websphere Application Server Configuration

I’m using a WebSphere Application Server 8.5 and Apache HTTPClient 4.5.2 for a REST consumer projects. Basically, we make HTTP Requests (well it’s more HTTPS) with the HTTPClient for consuming REST Web Services. We have 2 distincts projects: one in a .ear file and the other in a OSGI bundle (they are independent)

But the issue is the same : I wanted to use the configuration from the WAS (SSL configuration, certificates) with my httpclient connections.

How I can do that? Is it possible?


One thought on “Apache HTTPClient and Websphere Application Server Configuration”

  1. By default Apache’s HttpClient creates its own SSLContext instance, causing it to not pickup WAS’s. You can make HttpClient not create it’s own instance by calling the useSystemProperties() method. For example calling HttpClient something like this:
    HttpClientBuilder httpClientBuilder = HttpClients.custom().useSystemProperties()

Leave a Reply

Your email address will not be published.