makemehappy
makemehappy

Reputation: 43

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?

Thanks.

Upvotes: 1

Views: 2542

Answers (1)

Alaine
Alaine

Reputation: 439

By default Apache's HttpClient creates its own SSLContext instance, causing it to not pickup WAS's. You can make HttpClient not create its own instance by calling the useSystemProperties() method. For example, calling HttpClient would look something like this:

HttpClientBuilder httpClientBuilder = HttpClients.custom().useSystemProperties()

Upvotes: 4

Related Questions