You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Don Doffe <fo...@gmail.com> on 2011/07/06 09:32:56 UTC

camel-http4 loses auth credentials when a custom http client configurer is used

It seems that camel-http4 component  (or the httpclient ) loses credentials
when a custom HttpClientConfigurer is used.

Here is my configuration:

from("servlet:///proxy?matchOnUriPrefix=true")
		.removeHeader(Exchange.HTTP_URI)
		.removeHeader(Exchange.HTTP_PATH)
		.removeHeader(Exchange.HTTP_QUERY)
	
.to("https4://aupdc-osb01d:9002/P2P_Creditors/P2P_CreditorWS?wsdl&httpClientConfigurerRef=SecureHttpClientConfigurer&authUsername="+_authUsername+"&authPassword="+_authPassword+"&x509HostnameVerifier=AllowAllVerifier");

Here is the log output:

[                 qtp9368661-18] wire                           DEBUG <<
"[\r][\n]"
[                 qtp9368661-18] DefaultClientConnection        DEBUG
Receiving response: HTTP/1.1 401 Unauthorized
[                 qtp9368661-18] headers                        DEBUG <<
HTTP/1.1 401 Unauthorized
[                 qtp9368661-18] headers                        DEBUG <<
Connection: close
[                 qtp9368661-18] headers                        DEBUG <<
Date: Wed, 06 Jul 2011 07:28:04 GMT
[                 qtp9368661-18] headers                        DEBUG <<
Content-Length: 1518
[                 qtp9368661-18] headers                        DEBUG <<
Content-Type: text/html; charset=UTF-8
[                 qtp9368661-18] headers                        DEBUG <<
WWW-Authenticate: Basic realm="weblogic"
[                 qtp9368661-18] headers                        DEBUG <<
X-Powered-By: Servlet/2.5 JSP/2.1
[                 qtp9368661-18] DefaultHttpClient              DEBUG Target
requested authentication
[                 qtp9368661-18] ultTargetAuthenticationHandler DEBUG
Authentication schemes in the order of preference: [negotiate, NTLM, Digest,
Basic]
[                 qtp9368661-18] ultTargetAuthenticationHandler DEBUG
Challenge for negotiate authentication scheme not available
[                 qtp9368661-18] ultTargetAuthenticationHandler DEBUG
Challenge for NTLM authentication scheme not available
[                 qtp9368661-18] ultTargetAuthenticationHandler DEBUG
Challenge for Digest authentication scheme not available
[                 qtp9368661-18] ultTargetAuthenticationHandler DEBUG Basic
authentication scheme selected
[                 qtp9368661-18] DefaultHttpClient              DEBUG
Authorization challenge processed
[                 qtp9368661-18] DefaultHttpClient              DEBUG
Authentication scope: BASIC 'weblogic'@aupdc-osb01d:9002
[                 qtp9368661-18] DefaultHttpClient              DEBUG
Credentials not found


Notice credentials not found.

When I do not include the http client configurer, everything works.
HttpClientConfigurer does not do anything. Just an NOP:

@Override
	public void configureHttpClient(HttpClient client) {
}

I'm looking thorugh the source code but I can not figure it out...

Any ideas?

--
View this message in context: http://camel.465427.n5.nabble.com/camel-http4-loses-auth-credentials-when-a-custom-http-client-configurer-is-used-tp4556016p4556016.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-http4 loses auth credentials when a custom http client configurer is used

Posted by Don Doffe <fo...@gmail.com>.
Fully agree. 

To the best of my understanding the latest version (2.8.0 it is) does
provide this functionality.
I'm not sure when it is due for the release tho.


--
View this message in context: http://camel.465427.n5.nabble.com/camel-http4-loses-auth-credentials-when-a-custom-http-client-configurer-is-used-tp4556016p4556462.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-http4 loses auth credentials when a custom http client configurer is used

Posted by Björn Bength <bj...@gmail.com>.
Hello,

I recently hade to write my own HttpClientConfigurer when our client
has to do basic auth over ssl where both truststore and credentials
need to be configured.
I really think that support for this should be built into camel. That
is, camel should provide this utility clientconfigurerer.
It's not hard to write your own, but one should not need to just to
support this and other common use cases.

/Björn



On Wed, Jul 6, 2011 at 9:32 AM, Don Doffe <fo...@gmail.com> wrote:
>
> It seems that camel-http4 component  (or the httpclient ) loses credentials
> when a custom HttpClientConfigurer is used.
>
> Here is my configuration:
>
> from("servlet:///proxy?matchOnUriPrefix=true")
>                .removeHeader(Exchange.HTTP_URI)
>                .removeHeader(Exchange.HTTP_PATH)
>                .removeHeader(Exchange.HTTP_QUERY)
>
> .to("https4://aupdc-osb01d:9002/P2P_Creditors/P2P_CreditorWS?wsdl&httpClientConfigurerRef=SecureHttpClientConfigurer&authUsername="+_authUsername+"&authPassword="+_authPassword+"&x509HostnameVerifier=AllowAllVerifier");
>
> Here is the log output:
>
> [                 qtp9368661-18] wire                           DEBUG <<
> "[\r][\n]"
> [                 qtp9368661-18] DefaultClientConnection        DEBUG
> Receiving response: HTTP/1.1 401 Unauthorized
> [                 qtp9368661-18] headers                        DEBUG <<
> HTTP/1.1 401 Unauthorized
> [                 qtp9368661-18] headers                        DEBUG <<
> Connection: close
> [                 qtp9368661-18] headers                        DEBUG <<
> Date: Wed, 06 Jul 2011 07:28:04 GMT
> [                 qtp9368661-18] headers                        DEBUG <<
> Content-Length: 1518
> [                 qtp9368661-18] headers                        DEBUG <<
> Content-Type: text/html; charset=UTF-8
> [                 qtp9368661-18] headers                        DEBUG <<
> WWW-Authenticate: Basic realm="weblogic"
> [                 qtp9368661-18] headers                        DEBUG <<
> X-Powered-By: Servlet/2.5 JSP/2.1
> [                 qtp9368661-18] DefaultHttpClient              DEBUG Target
> requested authentication
> [                 qtp9368661-18] ultTargetAuthenticationHandler DEBUG
> Authentication schemes in the order of preference: [negotiate, NTLM, Digest,
> Basic]
> [                 qtp9368661-18] ultTargetAuthenticationHandler DEBUG
> Challenge for negotiate authentication scheme not available
> [                 qtp9368661-18] ultTargetAuthenticationHandler DEBUG
> Challenge for NTLM authentication scheme not available
> [                 qtp9368661-18] ultTargetAuthenticationHandler DEBUG
> Challenge for Digest authentication scheme not available
> [                 qtp9368661-18] ultTargetAuthenticationHandler DEBUG Basic
> authentication scheme selected
> [                 qtp9368661-18] DefaultHttpClient              DEBUG
> Authorization challenge processed
> [                 qtp9368661-18] DefaultHttpClient              DEBUG
> Authentication scope: BASIC 'weblogic'@aupdc-osb01d:9002
> [                 qtp9368661-18] DefaultHttpClient              DEBUG
> Credentials not found
>
>
> Notice credentials not found.
>
> When I do not include the http client configurer, everything works.
> HttpClientConfigurer does not do anything. Just an NOP:
>
> @Override
>        public void configureHttpClient(HttpClient client) {
> }
>
> I'm looking thorugh the source code but I can not figure it out...
>
> Any ideas?
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camel-http4-loses-auth-credentials-when-a-custom-http-client-configurer-is-used-tp4556016p4556016.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>