2016-11-30 61 views
0
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为**组元,但仍给我:无法找到有效的认证路径到要求的目标**HTTPS4使用的SSLContext与密钥存储文件,史迪威无法找到有效的认证路径要求的目标

回答

0

最后我发现它,我被困在HonyPot这是在我们的服务器,并且不认为HTTP4传递的代理服务器,所以我需要追加该计划到我的终点... proxyAuthHost=****&proxyAuthPort=80&proxyAuthScheme=http4