• SWATI KUSHWAHA
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

Hi, I'm trying to upload file to Google cloud. I need to assign the attachment to a key "document" and then upload using REST API
This is a screenshot from postman. I need to upload file in this format using REST API.
In java you achieve this by doing something like this
.body("------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"document\"; filename=\"Test.pdf\"\r\nContent-Type: application/pdf\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; )
How do we do this in apex. 
Can anyone help? Thanks in advance
Adheena

Hello, 

I'm trying to make a callout to the Web Service on the remote location(the port number is 9233). The web service is protected with SSL, and anything that I did so far I got the following exception:

System.HttpRequest retrying request in response to handshake failure: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

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

The certificate chain:

User-added image

The root certificate(GeoTrust Global CA) is trusted by Salesforce however the intermediate certificate (RapidSSL SHA 256 CA) is not on the list of trusted certificates. I tried to import the security certificate chain into Salesforce and then assigning that certificate to remote domain but that did not make any changes. 

Is there any way that I can confirm that the exceptions that we get are related to SSL setup on the remote machine and to the Salesforce setup?

Looking forward to any help on this issue.