HTTPS4使用带有密钥库文件的SSLcontext的组件配置,stil无法找到所请求目标的有效证书路径

时间:2016-11-30 21:21:31

标签: java ssl https apache-camel

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作为组件**但仍然给我:无法找到要求目标的有效证书路径**

1 个答案:

答案 0 :(得分:0)

最后我找到了它,我被我的服务器中的HonyPot困住了,并且不知道HTTP4是否通过了代理,所以我需要将该Scheme附加到我的端点...... {{1} }