HTTP proxy problem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

HTTP proxy problem

Ron Cecchini
Hi, all.

I have previously successfully used the HTTP component with proxy info to poll a site.

Bu now I'm running into a "connection reset" problem when polling another site that has a slightly different connection strategy.


The HTTP configuration for the first site was totally straight-forward:

    url.full =<query-params>

    proxy.params = authenticationPreemptive=true

and I was able to simply put the following in a timer route:



The second site requires a two-step login where you create an HTTP connection to:


and then send the credentials and query together to the same HTTP connection:


You can combine both steps into a single command.  For example, in curl this works:

    % curl https://www.<company>/ajaxauth/login -d 'identity=<user>&password=<password>&query=https://<query>'

And in fact, in a non-proxy environment, I was able to successfully poll the endpoint in Camel doing:

    url.login = https://www.<company>/ajaxauth/login  = identity=<user>&password=<password>&query=https://<query>

and putting this in my timer route:

    .setHeader(Exchange.CONTENT_TYPE, constant("application/x-www-form-urlencoded"))
    .setHeader(Exchange.HTTP_METHOD,  constant("POST"))
    .setBody(simple("{{}}"))   // makes the HTTP call a POST


But in a proxy environment, the second route no longer works.

With proxy info set to:

    proxy.params = authenticationPreemptive=true

I tried several combinations of where to put the proxy info; for example:

//    .setBody(simple("{{}}"))  // makes the HTTP call a POST
    .setBody(simple("{{}}&{{proxy.params}}"))  // makes the HTTP call a POST

but nothing worked.  Everything throws a Connection reset.

I tried some other stuff, like setting the several "timeout" HTTP component parameters to 0 to make them infinite timeouts, but that didn't work either.

Thanks for any help.