如何解决 400 The plain HTTP request was sent to HTTPS port 问题?
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)) ;
});
如果我使用“https4”组件,它可以在上面的 url(empValidation) 上工作,但它不适用于下面的 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)
我认为如果我们使用默认端口它不起作用,上述情况的解决方案是什么?