2

When connecting to Salesforce through WSO2, I an receiving the following error.

Unable to sendViaPost to url[https://semtech.my.salesforce.com/services/Soap/c/26.0/xxxxxJelG/0xxxxk] {org.apache.axis2.transport.http.HTTPSender}
org.apache.axis2.AxisFault: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.java:1293)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkWrite(SSLSocketImpl.java:1305)
    at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:43)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
    at org.apache.commons.httpclient.ChunkedOutputStream.flush(ChunkedOutputStream.java:191)
    at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:99)
    at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:214)
    at com.ctc.wstx.sw.BufferingXmlWriter.close(BufferingXmlWriter.java:194)
    at com.ctc.wstx.sw.BaseStreamWriter.finishDocument(BaseStreamWriter.java:1690)
    ... 43 more

Seems like there is a certificate change on Salesforce side. This is affecting our production site. How can I resolve this?

2 Answers 2

3
  1. First find out the salesforce api version you use.

  2. Then go to https://login.salesforce.com/services/Soap/u/32.0, click on the lock icon at the address bar, click on the 'Connection' tab, then click on the link 'Certificate Information'. From the 'Certificate Viewer', select the tab 'Details' and click on the 'Export' button and download the certificate (sf.com) to a preferred location. In here 32.0 is the salesforce api version.

This is the version of the API you are using in Salesforce. To obtain this, log into https://developer.salesforce.com/ and click Setup. On the left navigation pane, click API under Develop. Generate one of those APIs to check the version. This is not always v20.0 or 32. This can be different.

E.g., In the wsdl that will be generating, will show the following comment. It shows the API version. In this example it is v32.0

Salesforce.com Enterprise Web Services API Version 32.0

  1. Once downloaded, issue the below command to import the public certificate of salesforce to the client-truststore.jks.

    $ keytool -importcert -file $somepath/sf.com -keystore $ESB_HOME/repository/resources/security/client-truststore.jks -alias "sf"

  2. Restart the WSO2 ESB server and invoke the API again and you will get the expected result.

1
  • 1
    @Gopi: don't forget to accept this answer. To do so, click the tick mark to the left of the question, so it turns green. This is how we mark questions as resolved on Stack Overflow.
    – halfer
    Sep 7, 2015 at 6:51
0

Try and check this. Hopefully this would be helpful.

I guess problem would be the certificate at the server side would have been changed and your java wouldn't be aware of it. So I think you should make an effort to let Java know about the change in the certificate. I have explained the same in the link provided above.

2
  • Hi,I tried adding new certificate and it says that the certificate already exists.
    – Gops
    Aug 17, 2015 at 18:59
  • Tried to add where? Java keystore? Aug 17, 2015 at 22:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.