Description
When defining a config with a full endpoint url like https://my-domain-url.com/config
Quarkus does not succeed in getting configuration when it's protected by Basic Authentication
Expected behavior
Successful config retrieve
Actual behavior : 401 http response
Caused by: java.lang.RuntimeException: Got unexpected HTTP response code 401 from https://my-domain-url.com/config/config/my-app-name/dev
at io.quarkus.spring.cloud.config.client.runtime.DefaultSpringCloudConfigClientGateway.exchange(DefaultSpringCloudConfigClientGateway.java:66)
at io.quarkus.spring.cloud.config.client.runtime.SpringCloudConfigServerClientConfigSourceProvider.getConfigSources(SpringCloudConfigServerClientConfigSourceProvider.java:37)
Step by step :
To help resolve the issue , at start-up :
1) DefaultSpringCloudConfigClientGateway#determineBaseUri line 40 :
baseUri is the full endpoint "https://my-domain-url.com/config" instead of base uri "https://my-domain-url.com"
2) DefaultSpringCloudConfigClientGateway#setupContext line 83
authCache.put(HttpHost.create(baseUri), new BasicScheme());
3) org.apache.http.client.protocol.RequestAuthCache#process line 53
Target host is https://my-domain-url.com, port is < 0
line 58 :
target = new HttpHost(target.getHostName(), route.getTargetHost().getPort(), target.getSchemeName());
Description When defining a config with a full endpoint url like https://my-domain-url.com/config Quarkus does not succeed in getting configuration when it's protected by Basic Authentication
Expected behavior Successful config retrieve
Actual behavior : 401 http response
Configuration
Environment :
Step by step : To help resolve the issue , at start-up : 1) DefaultSpringCloudConfigClientGateway#determineBaseUri line 40 : baseUri is the full endpoint "https://my-domain-url.com/config" instead of base uri "https://my-domain-url.com"
2) DefaultSpringCloudConfigClientGateway#setupContext line 83
3) org.apache.http.client.protocol.RequestAuthCache#process line 53 Target host is https://my-domain-url.com, port is < 0
line 58 :
At this point target is https://my-domain-url.com:443 line 63 :
Result : AuthScheme is null, and function RequestAuthCache#doPreemptiveAuth is never call to set Authentication Basic
https://github.com/quarkusio/quarkus/issues/10350
$upstream:10350$