Within EurekaJerseyClient the apache client config is created outwith my control and I can see no way to configure a credentials provider into it.
public static JerseyClient createJerseyClient(String clientName, int connectionTimeout,
int readTimeout, int maxConnectionsPerHost,
int maxTotalConnections, int connectionIdleTimeout) {
Preconditions.checkNotNull(clientName, "Client name can not be null.");
try {
ClientConfig jerseyClientConfig = new CustomApacheHttpClientConfig(clientName, maxConnectionsPerHost,
maxTotalConnections);
return new JerseyClient(connectionTimeout, readTimeout,
connectionIdleTimeout, jerseyClientConfig);
} catch (Throwable e) {
throw new RuntimeException("Cannot create Jersey client ", e);
}
}
The only solution I have is to have a defaultZone which is hardcoded with the username and password
https://username:password@myhost:8761/eureka/
But the problem with this means that the username and password is logged out to our Eureka log files numerous times.
Does anyone have any pointers?
Many thanks
Chris