java - 将 SSLcontext 与 keystore 文件一起使用的 HTTPS4 组件配置,仍然无法找到到请求目标的有效证书路径

标签 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 用作 componenet** 但仍然给我:无法找到请求目标的有效证书路径 **

最佳答案

我终于找到了,我被我们服务器中的 HonyPot 困住了,它无法识别通过代理传递的 HTTP4,所以我只需要将该方案附加到我的端点...proxyAuthHost=* ***&proxyAuthPort=80&proxyAuthScheme=http4

关于java - 将 SSLcontext 与 keystore 文件一起使用的 HTTPS4 组件配置,仍然无法找到到请求目标的有效证书路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40898433/

相关文章:

java - 杀死 Java Process 对象

java - Java 8 Streams 中的过滤映射

java - 导入证书后仍然出现 SunCertPathBuilderException

c++ - 什么是 boost::asio::ssl::context::load_verify_file 以及如何使用它?

authentication - 使用 HTTPS 进行客户端-服务器通信

ios - 如何配置 Wireshark 以查看 HTTPS 流量?

java - 使用长变量作为其大小创建长数组时的错误感到困惑

java - log4j 层次结构中的内存泄漏

security - 颁发欺诈证书的有效 SSL 证书

ssl - 我可以在 msmtp 中选择 SSL/TLS 版本吗?