如何解决400普通的HTTP请求被发送到HTTPS端口问题?
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: 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)
我认为如果我们使用默认端口它不起作用,上述场景的解决方案是什么?
答案 0 :(得分:0)
嗯,这取决于端点是http
还是https
端点(使用服务器证书来加密客户端和服务器之间的流量)。无论在哪个端口号下发布。
https
,则需要使用https4://hostname...
http
端点,则需要使用http4://hostname...