1

We have to connect out java camel application with an external system over https. In the middle we have a proxy, but this proxy only accepts http connections.

I have configured http and https proxies in the camel context but it seems that this does not help. The http4s component runs into connection closed exception. So I configured the proxy directly at the https4 endpoint. This configuration works but it seems that the component wants to communicate over https with our proxy and I receive this exception.

javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

I inspect the debug log and I can see this log entry which indicates that the connection to the proxy is done over https

[DEBUG]: org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection request: [route: {tls}->https://<proxy>:<port>->https://<3rdPartySystem>:443][total kept alive: 0; route allocated: 0 of 20; total allocated: 0 of 200]

here the camel component configuration

to("https4:<3rdPartySystem>/services/oauth2/token?proxyAuthHost=...&proxyAuthPort=...")

So my question is: How can I configure a proxy in java in a way that https traffic is done over http between the java app and the proxy. From proxy to the 3rd party system communication should be done over https.

By the way the "old" http-camel component works perfect with the same proxy.

user3756702
  • 215
  • 5
  • 13

1 Answers1

0

use proxyAuthScheme=http to avoid the SSLException

Marcus A.
  • 651
  • 5
  • 3