Category Archives: apache-camel-aws

How to resolve the 400 The plain HTTP request was sent to HTTPS port issue in Apache Camel?

How to resolve the 400 The plain HTTP request was sent to HTTPS port issue?

from: empValidation
to: myhost:443/EmpValidation/EmpValidationAPIService
 rules.getRules().forEach(x->{
        final LoadBalanceDefinition lb =  from("jetty:http://0.0.0.0:"+rules.getPort()+"/"+x.getFrom()+"??matchOnUriPrefix=true").log(LoggingLevel.DEBUG, "Processing ${id}").log("Incoming Context Request :"+x.getFrom())
        .loadBalance().roundRobin();
        x.getTo().forEach(z->lb.to("http4://"+z+"?bridgeEndpoint=true&throwExceptionOnFailure=true").log("Outgoing mapping urls :"+z)) ;
      });

if i use "https4" component it's working the above url(empValidation) but it's not working for below url.

Url: myhost:9008/emp-web-service/services/addEmp

Error:
 javax.net.ssl.SSLHandshakeException: Remote host closed connection during 
 handshake
          at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
          at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:396)

I think if we use default port it's not working, what is solution for the above scenario?