[ 
https://issues.apache.org/jira/browse/CAMEL-20177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17792782#comment-17792782
 ] 

JJ edited comment on CAMEL-20177 at 12/4/23 11:22 AM:
------------------------------------------------------

Have tested with camel-http all the way up to current 4.2.0 from 4.0.0 all the 
show same error below; camel-http-3.21.2 does work.
{code:java}
DEBUG | >>>> 
https://api.solar.sheffield.ac.uk/pvlive/api/v4/pes/0?httpClient.cookieSpec=ignoreCookies
 Exchange[]
DEBUG | ex-0000000001 preparing request execution
DEBUG | ex-0000000001 target auth state: UNCHALLENGED
DEBUG | ex-0000000001 proxy auth state: UNCHALLENGED
DEBUG | ex-0000000001 acquiring connection with route 
{s}->https://api.solar.sheffield.ac.uk:443
DEBUG | ex-0000000001 acquiring endpoint (3 MINUTES)
DEBUG | ex-0000000001 endpoint lease request (3 MINUTES) [route: 
{s}->https://api.solar.sheffield.ac.uk:443][total available: 0; route 
allocated: 0 of 20; total allocated: 0 of 200]
DEBUG | ex-0000000001 endpoint leased [route: 
{s}->https://api.solar.sheffield.ac.uk:443][total available: 0; route 
allocated: 1 of 20; total allocated: 1 of 200]
DEBUG | ex-0000000001 acquired ep-0000000001
DEBUG | ex-0000000001 acquired endpoint ep-0000000001
DEBUG | ex-0000000001 opening connection 
{s}->https://api.solar.sheffield.ac.uk:443
DEBUG | ep-0000000001 connecting endpoint (null)
DEBUG | ep-0000000001 connecting endpoint to 
https://api.solar.sheffield.ac.uk:443 (3 MINUTES)
DEBUG | api.solar.sheffield.ac.uk resolving remote address
DEBUG | api.solar.sheffield.ac.uk resolved to 
[api.solar.sheffield.ac.uk/143.167.1.47]
DEBUG | http-outgoing-0 close connection IMMEDIATE
DEBUG | ep-0000000001 endpoint closed
DEBUG | ep-0000000001 discarding endpoint
DEBUG | ep-0000000001 releasing endpoint
DEBUG | ep-0000000001 connection is not kept alive
DEBUG | ep-0000000001 connection released [route: 
{s}->https://api.solar.sheffield.ac.uk:443][total available: 0; route 
allocated: 0 of 20; total allocated: 0 of 200]
DEBUG | Failed delivery for (MessageId: C842DF4C1E470E5-0000000000000000 on 
ExchangeId: C842DF4C1E470E5-0000000000000000). On delivery attempt: 0 caught: 
java.lang.IllegalArgumentException: Invalid Proxy
{code}
I'm running embedded log4j2 with {{rootLogger.level=DEBUG}} set so not sure if 
I need to enable anything else to get you some more details. This should be 
easy to replicate though and the url used in the example is a free to access 
url so you should be able to build the route yourself and try it.

 

Here is a working debug from 3.21.2;
{code:java}
DEBUG | >>>> 
https://api.solar.sheffield.ac.uk/pvlive/api/v4/pes/0?httpClient.cookieSpec=ignoreCookies
 Exchange[]
DEBUG | Executing http GET method: 
https://api.solar.sheffield.ac.uk/pvlive/api/v4/pes/0
DEBUG | CookieSpec selected: ignoreCookies
DEBUG | Auth cache not set in the context
DEBUG | Connection request: [route: 
{s}->https://api.solar.sheffield.ac.uk:443][total available: 0; route 
allocated: 0 of 20; total allocated: 0 of 200]
DEBUG | Connection leased: [id: 0][route: 
{s}->https://api.solar.sheffield.ac.uk:443][total available: 0; route 
allocated: 1 of 20; total allocated: 1 of 200]
DEBUG | Opening connection {s}->https://api.solar.sheffield.ac.uk:443
DEBUG | Connecting to api.solar.sheffield.ac.uk/143.167.1.47:443
DEBUG | Connecting socket to api.solar.sheffield.ac.uk/143.167.1.47:443 with 
timeout 0
DEBUG | Enabled protocols: [TLSv1.3, TLSv1.2]
DEBUG | Enabled cipher suites:[TLS_AES_256_GCM_SHA384, TLS_AES_128_GCM_SHA256, 
TLS_CHACHA20_POLY1305_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, 
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, 
TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, 
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, 
TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, 
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, 
TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, 
TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, 
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, 
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, 
TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, 
TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, 
TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, 
TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, 
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, 
TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, 
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, 
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, 
TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, 
TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, 
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, 
TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, 
TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_128_GCM_SHA256, 
TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, 
TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, 
TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
DEBUG | Starting handshake
DEBUG | Secure session established
DEBUG |  negotiated protocol: TLSv1.3
DEBUG |  negotiated cipher suite: TLS_AES_256_GCM_SHA384
DEBUG |  peer principal: CN=www.solar.sheffield.ac.uk, O=University of 
Sheffield, ST=South Yorkshire, C=GB
DEBUG |  peer alternative names: [www.solar.sheffield.ac.uk, 
api.solar.shef.ac.uk, api.solar.sheffield.ac.uk, api0.solar.shef.ac.uk, 
api0.solar.sheffield.ac.uk, staging.solar.shef.ac.uk, 
staging.solar.sheffield.ac.uk, www.solar.shef.ac.uk]
DEBUG |  issuer principal: CN=GEANT OV RSA CA 4, O=GEANT Vereniging, C=NL
DEBUG | Connection established 172.16.0.2:59794<->143.167.1.47:443
DEBUG | Executing request GET /pvlive/api/v4/pes/0 HTTP/1.1
DEBUG | Target auth state: UNCHALLENGED
DEBUG | Proxy auth state: UNCHALLENGED
DEBUG | http-outgoing-0 >> GET /pvlive/api/v4/pes/0 HTTP/1.1
DEBUG | http-outgoing-0 >> firedTime: Mon Dec 04 11:21:19 GMT 2023
DEBUG | http-outgoing-0 >> Host: api.solar.sheffield.ac.uk
DEBUG | http-outgoing-0 >> Connection: Keep-Alive
DEBUG | http-outgoing-0 >> User-Agent: Apache-HttpClient/4.5.14 (Java/18.0.2)
DEBUG | http-outgoing-0 >> Accept-Encoding: gzip,deflate
DEBUG | http-outgoing-0 >> "GET /pvlive/api/v4/pes/0 HTTP/1.1[\r][\n]"
DEBUG | http-outgoing-0 >> "firedTime: Mon Dec 04 11:21:19 GMT 2023[\r][\n]"
DEBUG | http-outgoing-0 >> "Host: api.solar.sheffield.ac.uk[\r][\n]"
DEBUG | http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
DEBUG | http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.5.14 
(Java/18.0.2)[\r][\n]"
DEBUG | http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
DEBUG | http-outgoing-0 >> "[\r][\n]"
DEBUG | http-outgoing-0 << "HTTP/1.1 200 OK[\r][\n]"
DEBUG | http-outgoing-0 << "Server: nginx/1.22.0 (Ubuntu)[\r][\n]"
DEBUG | http-outgoing-0 << "Date: Mon, 04 Dec 2023 11:21:19 GMT[\r][\n]"
DEBUG | http-outgoing-0 << "Content-Type: application/json; 
charset=utf-8[\r][\n]"
DEBUG | http-outgoing-0 << "Content-Length: 95[\r][\n]"
DEBUG | http-outgoing-0 << "Connection: keep-alive[\r][\n]"
DEBUG | http-outgoing-0 << "Permissions-Policy: browsing-topics=()[\r][\n]"
DEBUG | http-outgoing-0 << "X-Frame-Options: SAMEORIGIN[\r][\n]"
DEBUG | http-outgoing-0 << "X-Content-Type-Options: nosniff[\r][\n]"
DEBUG | http-outgoing-0 << "Content-Security-Policy: default-src 'self'; 
connect-src 'self' region1.google-analytics.com; font-src 'self' 
cdnjs.cloudflare.com; form-action 'self'; frame-ancestors 'self'; frame-src 
'self' www.google.com; img-src 'self' data: cdnjs.cloudflare.com 
region1.google-analytics.com www.googletagmanager.com 
'nonce-tP9QwwlWPqrLZFn8c_dPXkar3TBZXr_t'; script-src 'self' 
cdnjs.cloudflare.com cdn.jsdelivr.net code.jquery.com www.google.com 
www.googletagmanager.com www.gstatic.com region1.google-analytics.com 
'nonce-tP9QwwlWPqrLZFn8c_dPXkar3TBZXr_t'; style-src 'self' cdnjs.cloudflare.com 
cdn.jsdelivr.net 'nonce-tP9QwwlWPqrLZFn8c_dPXkar3TBZXr_t'[\r][\n]"
DEBUG | http-outgoing-0 << "Strict-Transport-Security: max-age=31556926; 
includeSubDomains[\r][\n]"
DEBUG | http-outgoing-0 << "Referrer-Policy: 
strict-origin-when-cross-origin[\r][\n]"
DEBUG | http-outgoing-0 << "Access-Control-Allow-Origin: 
https://staging.solar.sheffield.ac.uk[\r][\n]";
DEBUG | http-outgoing-0 << "Vary: Origin, Accept-Encoding, Cookie[\r][\n]"
DEBUG | http-outgoing-0 << "X-Content-Type-Options: nosniff[\r][\n]"
DEBUG | http-outgoing-0 << "X-XSS-Protection: 1; mode=block[\r][\n]"
DEBUG | http-outgoing-0 << "X-Frame-Options: DENY[\r][\n]"
DEBUG | http-outgoing-0 << "[\r][\n]"
DEBUG | http-outgoing-0 << 
"{"data":[[0,"2023-12-04T11:00:00Z",418.008]],"meta":["pes_id","datetime_gmt","generation_mw"]}[\n]"
DEBUG | http-outgoing-0 << HTTP/1.1 200 OK
DEBUG | http-outgoing-0 << Server: nginx/1.22.0 (Ubuntu)
DEBUG | http-outgoing-0 << Date: Mon, 04 Dec 2023 11:21:19 GMT
DEBUG | http-outgoing-0 << Content-Type: application/json; charset=utf-8
DEBUG | http-outgoing-0 << Content-Length: 95
DEBUG | http-outgoing-0 << Connection: keep-alive
DEBUG | http-outgoing-0 << Permissions-Policy: browsing-topics=()
DEBUG | http-outgoing-0 << X-Frame-Options: SAMEORIGIN
DEBUG | http-outgoing-0 << X-Content-Type-Options: nosniff
DEBUG | http-outgoing-0 << Content-Security-Policy: default-src 'self'; 
connect-src 'self' region1.google-analytics.com; font-src 'self' 
cdnjs.cloudflare.com; form-action 'self'; frame-ancestors 'self'; frame-src 
'self' www.google.com; img-src 'self' data: cdnjs.cloudflare.com 
region1.google-analytics.com www.googletagmanager.com 
'nonce-tP9QwwlWPqrLZFn8c_dPXkar3TBZXr_t'; script-src 'self' 
cdnjs.cloudflare.com cdn.jsdelivr.net code.jquery.com www.google.com 
www.googletagmanager.com www.gstatic.com region1.google-analytics.com 
'nonce-tP9QwwlWPqrLZFn8c_dPXkar3TBZXr_t'; style-src 'self' cdnjs.cloudflare.com 
cdn.jsdelivr.net 'nonce-tP9QwwlWPqrLZFn8c_dPXkar3TBZXr_t'
DEBUG | http-outgoing-0 << Strict-Transport-Security: max-age=31556926; 
includeSubDomains
DEBUG | http-outgoing-0 << Referrer-Policy: strict-origin-when-cross-origin
DEBUG | http-outgoing-0 << Access-Control-Allow-Origin: 
https://staging.solar.sheffield.ac.uk
DEBUG | http-outgoing-0 << Vary: Origin, Accept-Encoding, Cookie
DEBUG | http-outgoing-0 << X-Content-Type-Options: nosniff
DEBUG | http-outgoing-0 << X-XSS-Protection: 1; mode=block
DEBUG | http-outgoing-0 << X-Frame-Options: DENY
DEBUG | Connection can be kept alive indefinitely
DEBUG | Http responseCode: 200
DEBUG | Connection [id: 0][route: {s}->https://api.solar.sheffield.ac.uk:443] 
can be kept alive indefinitely
DEBUG | http-outgoing-0: set socket timeout to 0
DEBUG | Connection released: [id: 0][route: 
{s}->https://api.solar.sheffield.ac.uk:443][total available: 1; route 
allocated: 1 of 20; total allocated: 1 of 200]
DEBUG | StaxConverter pool size: 20
DEBUG | >>>> localAMQ://queue:Solar Exchange[ED5DF2236A1E6E3-0000000000000000] 
{code}


was (Author: jj-amq):
Have tested with camel-http all the way up to current 4.2.0 from 4.0.0 all the 
show same error below; camel-http-3.21.2 does work.
{code:java}
DEBUG | >>>> 
https://api.solar.sheffield.ac.uk/pvlive/api/v4/pes/0?httpClient.cookieSpec=ignoreCookies
 Exchange[]
DEBUG | ex-0000000001 preparing request execution
DEBUG | ex-0000000001 target auth state: UNCHALLENGED
DEBUG | ex-0000000001 proxy auth state: UNCHALLENGED
DEBUG | ex-0000000001 acquiring connection with route 
{s}->https://api.solar.sheffield.ac.uk:443
DEBUG | ex-0000000001 acquiring endpoint (3 MINUTES)
DEBUG | ex-0000000001 endpoint lease request (3 MINUTES) [route: 
{s}->https://api.solar.sheffield.ac.uk:443][total available: 0; route 
allocated: 0 of 20; total allocated: 0 of 200]
DEBUG | ex-0000000001 endpoint leased [route: 
{s}->https://api.solar.sheffield.ac.uk:443][total available: 0; route 
allocated: 1 of 20; total allocated: 1 of 200]
DEBUG | ex-0000000001 acquired ep-0000000001
DEBUG | ex-0000000001 acquired endpoint ep-0000000001
DEBUG | ex-0000000001 opening connection 
{s}->https://api.solar.sheffield.ac.uk:443
DEBUG | ep-0000000001 connecting endpoint (null)
DEBUG | ep-0000000001 connecting endpoint to 
https://api.solar.sheffield.ac.uk:443 (3 MINUTES)
DEBUG | api.solar.sheffield.ac.uk resolving remote address
DEBUG | api.solar.sheffield.ac.uk resolved to 
[api.solar.sheffield.ac.uk/143.167.1.47]
DEBUG | http-outgoing-0 close connection IMMEDIATE
DEBUG | ep-0000000001 endpoint closed
DEBUG | ep-0000000001 discarding endpoint
DEBUG | ep-0000000001 releasing endpoint
DEBUG | ep-0000000001 connection is not kept alive
DEBUG | ep-0000000001 connection released [route: 
{s}->https://api.solar.sheffield.ac.uk:443][total available: 0; route 
allocated: 0 of 20; total allocated: 0 of 200]
DEBUG | Failed delivery for (MessageId: C842DF4C1E470E5-0000000000000000 on 
ExchangeId: C842DF4C1E470E5-0000000000000000). On delivery attempt: 0 caught: 
java.lang.IllegalArgumentException: Invalid Proxy
{code}
I'm running embedded log4j2 with {{rootLogger.level=DEBUG}} set so not sure if 
I need to enable anything else to get you some more details. This should be 
easy to replicate though and the url used in the example is a free to access 
url so you should be able to build the route yourself and try it.

> http route fails - invalid proxy when none is used
> --------------------------------------------------
>
>                 Key: CAMEL-20177
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20177
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-http
>    Affects Versions: 4.0.3
>         Environment: EL7
> java-latest-openjdk-18.0.2.0.9-1.rolling.el7.x86_64
> Camel 4.0.3 Embedded in ActiveMQ 6.0.0
>  
>            Reporter: JJ
>            Priority: Minor
>              Labels: help-wanted
>
> I have a simple {{timer}} route which collects data from a http request. 
> However after upgrading to {{camel-4.0.3}} this no longer works, no body is 
> fetched and the message is sent to the DLQ. Using {{camel-3.21.1}} it works 
> as expected with no errors and the messages body appears on the correct topic 
> for consumption.
> {code:xml}
> <route id="solar_pull">
>   <from uri="timer:nationalSolar?fixedRate=true&period=300000" />}}
>   <to 
> uri="https://api.solar.sheffield.ac.uk/pvlive/api/v4/pes/0?httpClient.cookieSpec=ignoreCookies";
>  />}}
>   <to uri="localAMQ:topic:Solar"/>}}
> </route>
> {code}
> It simply fetches some {{json}} data as shown below;
> {code:java}
> {"data":[[0,"2023-11-27T23:00:00Z",0.0]],"meta":["pes_id","datetime_gmt","generation_mw"]}{code}
> With Camel 4.0.3 the following strange error is logged in full debug mode;
> {{java.lang.IllegalArgumentException: Invalid Proxy}}
> {code:java}
> DEBUG | >>>> 
> https://api.solar.sheffield.ac.uk/pvlive/api/v4/pes/0?httpClient.cookieSpec=ignoreCookies
>  Exchange[]
> DEBUG | ex-0000000001 preparing request execution
> DEBUG | ex-0000000001 target auth state: UNCHALLENGED
> DEBUG | ex-0000000001 proxy auth state: UNCHALLENGED
> DEBUG | ex-0000000001 acquiring connection with route 
> {s}->https://api.solar.sheffield.ac.uk:443
> DEBUG | ex-0000000001 acquiring endpoint (3 MINUTES)
> DEBUG | ex-0000000001 endpoint lease request (3 MINUTES) [route: 
> {s}->https://api.solar.sheffield.ac.uk:443][total available: 0; route 
> allocated: 0 of 20; total allocated: 0 of 200]
> DEBUG | ex-0000000001 endpoint leased [route: 
> {s}->https://api.solar.sheffield.ac.uk:443][total available: 0; route 
> allocated: 1 of 20; total allocated: 1 of 200]
> DEBUG | ex-0000000001 acquired ep-0000000001
> DEBUG | ex-0000000001 acquired endpoint ep-0000000001
> DEBUG | ex-0000000001 opening connection 
> {s}->https://api.solar.sheffield.ac.uk:443
> DEBUG | ep-0000000001 connecting endpoint (null)
> DEBUG | ep-0000000001 connecting endpoint to 
> https://api.solar.sheffield.ac.uk:443 (3 MINUTES)
> DEBUG | api.solar.sheffield.ac.uk resolving remote address
> DEBUG | api.solar.sheffield.ac.uk resolved to 
> [api.solar.sheffield.ac.uk/143.167.1.47]
> DEBUG | http-outgoing-0 close connection IMMEDIATE
> DEBUG | ep-0000000001 endpoint closed
> DEBUG | ep-0000000001 discarding endpoint
> DEBUG | ep-0000000001 releasing endpoint
> DEBUG | ep-0000000001 connection is not kept alive
> DEBUG | ep-0000000001 connection released [route: 
> {s}->https://api.solar.sheffield.ac.uk:443][total available: 0; route 
> allocated: 0 of 20; total allocated: 0 of 200]
> DEBUG | Failed delivery for (MessageId: F2235F0F816E9CF-0000000000000000 on 
> ExchangeId: F2235F0F816E9CF-0000000000000000). On delivery attempt: 0 caught: 
> java.lang.IllegalArgumentException: Invalid Proxy
> DEBUG | >>>> localAMQ://queue:DLQ-Camel 
> Exchange[F2235F0F816E9CF-0000000000000000]{code}
> I've been through the 
> [docs|https://camel.apache.org/components/4.0.x/http-component.html] but 
> can't see anything obvious as to what's changed. I've also checked the 
> [migration|https://camel.apache.org/manual/camel-4-migration-guide.html] doc.
> Have I missed or misunderstood something or have I found a bug?
> What is the correct way to migrate this route to Camel >4 ?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to