Skip to main content

Hi All,

 

We are currently facing following error in our Mule applications where SALESFORCE connector is used.

We encountered this before where we restarted mule run-time to solve the issue and it worked. But now we started getting same error again where restart of mule server is even not solving the issue.

 

We are using mule 3.9 runtime and salesforce 8.10.0 connector.

 

Root Exception stack trace:

org.mule.modules.salesforce.config.login.exception.LoginException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

at org.mule.modules.salesforce.config.login.LoginServiceImpl.login(LoginServiceImpl.java:54)

at org.mule.modules.salesforce.config.SalesforceOAuthUserPasswordConfig.connect(SalesforceOAuthUserPasswordConfig.java:95)

 

as far as we know no SSL config or certificate details required for salesforce connector. 

Could you please let us know what could be the reason for this exception? or if you have came across any similar issue with Salesforce connector.

 

We are currently stuck with this error. Any help is highly appreciated!

9 个回答
  1. 2021年8月9日 15:17

    Hi @Vaishnavi Dhongadi​,

     

    In our case it was Mule On-Prem. Looks like you are using Mule On-prem as well.

     

    Issue:

    sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

     

    Rootcause:

    In our case we have kept all our certs (JKS files) except the ones comes with default JDK cacerts in a custom folder for easy maintenance purpose. Salesforce certs are part of default JDK cacerts (jdk1.8.0_65/jre/lib/security/cacerts) that is why we don't add any certs for connecting to Salesforce.

     

    For instance, we have an integration with Adobe application. So, we have kept adobe jks file in /apps/MuleSoftESB/dev/certs/adobe.jks (certs is our custom folder).

     

    This issue has happened not because of Salesforce certs which exists in jdk cacerts. It is because of race condition with adobe.jks. Due to race condition with adobe.jks cert, default truststore is getting set to our custom folder path instead of default jdk cacerts path.

     

    When ever the default truststore path is set to use ADOBE.jks the SFDC connector is also searching the certificates there and it obviously fails as there is no Salesforce cert in our custom folder. Hence, getting above PKIX path building failed error.

     

    Solution:

    Step1: Copy default jdk cacerts FROM /apps/jdk1.8.0_65/jre/lib/security/cacerts ---> /apps/MuleSoftESB/dev/certs/cacertsCustom.jks

     

    Step2: add adobje.jks file to the above cacertsCustom.jks

     

    with this, even if mule is setting the default trust store to cacertsCustom.jks file all certs including Salesforce certs will be in this jks file and we no longer received PKIX path building failed error.

     

    Summary:

    I am not sure if this is the same scenario in your case, if yes, then you can try following the above suggested steps.

     

    If your scenario is not similar to mine, then try enabling ssl handshake in the wrapper.conf using below command and verify the log file for more details.

    -Djavax.net.debug=ssl:handshake

     

    Thanks,

    Bala