davsclaus commented on code in PR #26167:
URL: https://github.com/apache/camel/pull/26167#discussion_r3950194620


##########
components/camel-http/src/test/java/org/apache/camel/component/http/HttpProxyServerTest.java:
##########
@@ -143,6 +147,30 @@ public void httpGetWithProxyOnComponent() {
         assertExchange(exchange);
     }
 
+    @Test
+    public void httpsTargetWithProxyDefaultsToHttpProxyScheme() throws 
Exception {
+        // CAMEL-24632: proxy scheme must default to "http" regardless of the 
target endpoint scheme
+        HttpEndpoint endpoint = context.getEndpoint(
+                "https://www.example.com?proxyHost=myproxy&proxyPort=8080";, 
HttpEndpoint.class);
+
+        HttpClientConfigurer configurer = endpoint.getHttpClientConfigurer();
+        assertThat(configurer).isNotNull();
+
+        HttpClientBuilder builder = HttpClientBuilder.create();
+        configurer.configureHttpClient(builder);
+
+        Field proxyField = HttpClientBuilder.class.getDeclaredField("proxy");
+        proxyField.setAccessible(true);

Review Comment:
   Acknowledged. The reflection approach is the only practical way to verify 
the configured proxy scheme without executing a real request — HC5's 
`HttpClientBuilder` has no public accessor for the proxy field. The trade-off 
is acceptable for a regression test since it fails noisily (field-not-found 
error) if the HC5 internals ever change, which would prompt a targeted fix. 
Happy to revisit if a cleaner HC5 API surfaces in a future release.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to