[
https://issues.apache.org/jira/browse/CAMEL-20254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17798905#comment-17798905
]
Claus Ibsen commented on CAMEL-20254:
-------------------------------------
Thanks for reporting and with the sample project
~/Downloads/camel-auth-example ❯ curl -i localhost:8080/proxy
HTTP/1.1 200 OK
Server: Jetty(12.0.5)
Content-Type: text/plain
Accept: */*
Last-Modified: Fri, 15 Dec 2023 15:46:57 GMT
Server: SimpleHTTP/0.6 Python/3.11.6
Transfer-Encoding: chunked
hello world!
> camel-http - pre-emptive authentication breaks basic auth
> ---------------------------------------------------------
>
> Key: CAMEL-20254
> URL: https://issues.apache.org/jira/browse/CAMEL-20254
> Project: Camel
> Issue Type: Bug
> Components: camel-http
> Affects Versions: 4.2.0
> Reporter: Billy Jaime Beltran
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 4.4.0
>
> Attachments: camel-auth-example.zip
>
>
> Background:
> When setting setAuthenticationPreemptiveon to true on an http endpoint, basic
> authentication ceases to work
>
> Error:
>
> {noformat}
> 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]{noformat}
>
> {code:java}
> httpEndpoint.setAuthMethod("Basic");
> httpEndpoint.setAuthUsername("admin");
> httpEndpoint.setAuthPassword("admin");
> /* enable or disable this line and the program works/does not work */
> httpEndpoint.setAuthenticationPreemptive(true);
> {code}
>
>
> I attach a sample project with run instructions and a small shell python web
> server with basic auth configured.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)