Apache Camel https connection through Burp Suite proxy gives SSLException: Unsupported or unrecognized SSL message

I want to send my camel connections through Burp Suite Proxy. I have imported my Burp Suite certificate to cacerts.

So the following example does work, the request appears in Burp Suite and program exits with no errors.

  public static void request() {
    try {
      String url = "https://example.com";

      Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("localhost", 8080));

      URL obj = new URL(url);
      HttpURLConnection con = (HttpURLConnection) obj.openConnection(proxy);

      con.setRequestMethod("GET");
      int responseCode = con.getResponseCode();
      System.out.println("Response Code: " + responseCode);

      BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
      String inputLine;
      StringBuilder response = new StringBuilder();

      while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
      }
      in.close();

      System.out.println("Response Content:");
      System.out.println(response.toString());
    } catch (IOException e) {
      e.printStackTrace();
    }
  }

Now I want to do the same thing in Camel but I get javax.net.ssl.SSLException: Unsupported or unrecognized SSL message:

2024-07-01T18:55:05,280 my-app DEBUG [Camel (MyCamel) thread #14 - file://data/population/pupil] o.a.c.c.f.GenericFileConsumer.poll(GenericFileConsumer.java:154) Took 1ms to poll: datapopulationpupil
2024-07-01T18:55:05,280 my-app DEBUG [Camel (MyCamel) thread #15 - timer://foo] o.a.c.p.SendProcessor.process(SendProcessor.java:171) >>>> https://example.com Exchange[]
2024-07-01T18:55:05,281 my-app DEBUG [Camel (MyCamel) thread #15 - timer://foo] o.a.c.c.h.HttpProducer.process(HttpProducer.java:273) Executing http GET method: https://example.com
2024-07-01T18:55:05,281 my-app DEBUG [Camel (MyCamel) thread #15 - timer://foo] o.a.h.c.p.RequestAddCookies.process(RequestAddCookies.java:123) CookieSpec selected: default
2024-07-01T18:55:05,281 my-app DEBUG [Camel (MyCamel) thread #15 - timer://foo] o.a.h.c.p.RequestAuthCache.process(RequestAuthCache.java:77) Auth cache not set in the context
2024-07-01T18:55:05,281 my-app DEBUG [Camel (MyCamel) thread #15 - timer://foo] o.a.h.i.c.PoolingHttpClientConnectionManager.requestConnection(PoolingHttpClientConnectionManager.java:267) Connection request: [route: {tls}->https://localhost:8080->https://example.com:443][total available: 0; route allocated: 0 of 20; total allocated: 0 of 200]
2024-07-01T18:55:05,281 my-app DEBUG [Camel (MyCamel) thread #15 - timer://foo] o.a.h.i.c.PoolingHttpClientConnectionManager.leaseConnection(PoolingHttpClientConnectionManager.java:312) Connection leased: [id: 1][route: {tls}->https://localhost:8080->https://example.com:443][total available: 0; route allocated: 1 of 20; total allocated: 1 of 200]
2024-07-01T18:55:05,281 my-app DEBUG [Camel (MyCamel) thread #15 - timer://foo] o.a.h.i.e.MainClientExec.execute(MainClientExec.java:234) Opening connection {tls}->https://localhost:8080->https://example.com:443
2024-07-01T18:55:05,282 my-app DEBUG [Camel (MyCamel) thread #15 - timer://foo] o.a.h.i.c.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:139) Connecting to localhost/127.0.0.1:8080
2024-07-01T18:55:05,282 my-app DEBUG [Camel (MyCamel) thread #15 - timer://foo] o.a.h.c.s.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:366) Connecting socket to localhost/127.0.0.1:8080 with timeout 0
2024-07-01T18:55:05,283 my-app DEBUG [Camel (MyCamel) thread #15 - timer://foo] o.a.h.c.s.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:430) Enabled protocols: [TLSv1.3, TLSv1.2]
2024-07-01T18:55:05,283 my-app DEBUG [Camel (MyCamel) thread #15 - timer://foo] o.a.h.c.s.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:431) Enabled cipher suites:[TLS_AES_256_GCM_SHA384, TLS_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, 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]
2024-07-01T18:55:05,283 my-app DEBUG [Camel (MyCamel) thread #15 - timer://foo] o.a.h.c.s.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:435) Starting handshake
2024-07-01T18:55:05,406 my-app DEBUG [Thread-5 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$6@42d7b96)] o.a.a.a.c.s.i.QueueImpl.deliver(QueueImpl.java:2958) Queue login/success doing deliver. messageReferences=0 with consumers=1
...
<unrelated lines omitted>
...
2024-07-01T18:26:55,368 my-app DEBUG [Camel (MyCamel) thread #15 - timer://foo] o.a.h.i.c.PoolingHttpClientConnectionManager.releaseConnection(PoolingHttpClientConnectionManager.java:351) Connection released: [id: 1][route: {tls}->https://localhost:8080->https://example.com:443][total available: 0; route allocated: 0 of 20; total allocated: 0 of 200]
2024-07-01T18:26:55,368 my-app DEBUG [Camel (MyCamel) thread #15 - timer://foo] o.a.c.p.Pipeline.continueProcessing(PipelineHelper.java:66) Message exchange has failed: so breaking out of pipeline for exchange: Exchange[] Exception: javax.net.ssl.SSLException: Unsupported or unrecognized SSL message

This is how my route looks like:

import org.apache.camel.builder.RouteBuilder;
import org.springframework.stereotype.Component;

@Component
public class MyRoute extends RouteBuilder {

  @Override
  public void configure() throws Exception {

    getCamelContext().getGlobalOptions().put("http.proxyHost", "localhost");
    getCamelContext().getGlobalOptions().put("http.proxyPort", "8080");

    onException(Exception.class)
      .handled(true)
      .log("Exception occurred : ${exception.message}")
      .end();

    from("timer://foo?fixedRate=true&period=60000")
      .startupOrder(1)
      .to("https://example.com")
      .convertBodyTo(String.class)
      .log("Response : ${body}");
  }
}

I don’t understand why camel does not work while request method aboce worked? Previous code working should demonstrate that host, port, cert all work and it should not be the problem of configuration.

For your information it’s Spring Boot 2.7.18 application using camel 3.14.9 running on Java 8. I cannot upgrade this currently due to technical debt so I am currently interested in solutions that I can use with what I have. In Burp suite settings under TLS negotiation I have selected “Use all supported protocols and ciphers of your Java installation”

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật