public void configure() throws Exception {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource(getConfigDir() + keystore);
ksp.setPassword("changeit");
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
SSLContextParameters scp = new SSLContextParameters();
scp.setTrustManagers(tmp);
HttpComponent httpComponent = getContext().getComponent("https4", HttpComponent.class);
httpComponent.setSslContextParameters(scp);
from("timer://timer1?fixedRate=true&period=5000")
.setHeader(Exchange.HTTP_METHOD, constant(HttpMethods.GET))
.to(getSource())
.log(LoggingLevel.INFO, "File ${file:name} inProgress")
.to(getDestination()).process(new Processor() {
public void process(Exchange exchange) throws Exception {
String currentFileName = (String) exchange.getIn().getHeader(Exchange.FILE_NAME);
Long currentFileSize = (Long) exchange.getIn().getHeader(Exchange.FILE_LENGTH);
feedLogger.log(Level.INFO, currentFileName + " processed");
feedLogger.log(Level.INFO, currentFileName + " size: " + currentFileSize + " Bytes");
}
}).log(LoggingLevel.INFO, "File ${file:name} processed").setId(getId());
}
我的来源,让我们说 https: https://www.blabla.org并且我将 HTTP4 用作 componenet** 但仍然给我:无法找到请求目标的有效证书路径 **
最佳答案
我终于找到了,我被我们服务器中的 HonyPot 困住了,它无法识别通过代理传递的 HTTP4,所以我只需要将该方案附加到我的端点...proxyAuthHost=* ***&proxyAuthPort=80&proxyAuthScheme=http4
关于java - 将 SSLcontext 与 keystore 文件一起使用的 HTTPS4 组件配置,仍然无法找到到请求目标的有效证书路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40898433/