Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
4.2.0
-
None
-
Unknown
Description
Background:
When setting setAuthenticationPreemptiveon to true on an http endpoint, basic authentication ceases to work
Error:
org.apache.hc.client5.http.ClientProtocolException: No credentials for preemptive authentication at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:173) ~[httpclient5-5.2.1.jar:5.2.1] at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:245) ~[httpclient5-5.2.1.jar:5.2.1] at org.apache.camel.component.http.HttpProducer.executeMethod(HttpProducer.java:487) ~[camel-http-4.2.0.jar:4.2.0] at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:269) ~[camel-http-4.2.0.jar:4.2.0] at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:65) [camel-support-4.2.0.jar:4.2.0]
httpEndpoint.setAuthMethod("Basic"); httpEndpoint.setAuthUsername("admin"); httpEndpoint.setAuthPassword("admin"); /* enable or disable this line and the program works/does not work */ httpEndpoint.setAuthenticationPreemptive(true);
I attach a sample project with run instructions and a small shell python web server with basic auth configured.
Attachments
Attachments
Issue Links
- links to