首页 > 解决方案 > 证书不匹配任何主题替代名称:[]

问题描述

我想调用 HTTPS api,但遇到问题:sun.security.validator.ValidatorException:PKIX 路径构建失败:我在 $JAVA_HOME/...securit/cacerts 中添加了证书,但是我有一个错误:证书不匹配任何主题替代名称:[]

你能帮我解决这个问题吗?

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" 
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xmlns:camel="http://camel.apache.org/schema/blueprint"

    xsi:schemaLocation="
             http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
             http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">

      <camel:sslContextParameters
      xmlns="http://camel.apache.org/schema/blueprint"
      id="sslContextParameters">
    <camel:keyManagers
        keyPassword="osslab">
      <camel:keyStore
          resource="/home/ossl/clients/KeyStore.jks"
          password="osslab"/>
    </camel:keyManagers>
    <camel:trustManagers>
      <camel:keyStore
          resource="/home/ossl/clients/truststore.jks"
          password="osslab"/>
    </camel:trustManagers>
  </camel:sslContextParameters>
    <camelContext trace="true" xmlns="http://camel.apache.org/schema
           <route id="http4-route">
            <from uri="timer://webinar?period=1000"/> 
                 <setHeader headerName="CamelHttpMethod">
                      <constant>GET</constant>
                  </setHeader>
              <to uri="https4://THe API Address:7080/sms/hi?sslContextParametersRef=sslContextParameters"/>
          <log message="message sent!"/>
           </route>
    </camelContext>
</blueprint>

标签: apihttpsapache-camelssl-certificate

解决方案


推荐阅读