Basic Auth REST Message throwing "Unable to load certificate" error

raprohaska
Kilo Guru

I have a basic auth defined REST Message. When I test the service through the REST Message interface, it works fine. When I invoke from script though, I get the following error as if it is trying mutual authentication:

"Unable to load certificate : WebVan Mutual Auth Keystore"

The Rest message has Basic auth set with a Basic profile. At the method level it
inherits authentication from the parent. I basically copied the Preview Script Usage
generated code. I've also tried setting authentication information directly in script with
the same results.

var requestContent = {
email: "email@email.com",
};

//setup REST Message
var r = new sn_ws.RESTMessageV2('message_name', 'method_name');
r.setRequestBody(JSON.stringify(requestContent));
gs.log(r.getRequestBody());

//Execute the request
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
gs.log(httpStatus);
1 ACCEPTED SOLUTION

raprohaska
Kilo Guru

The error being logged must be from some other sub process in SN. The issue ended up being with the JSON being set as the message content. Once I corrected the JSON, it began working. Found the typo when I was advised to use the set string parameter method instead of set request body.

 

This is a big DOH! on my behalf.

 

 

View solution in original post

1 REPLY 1

raprohaska
Kilo Guru

The error being logged must be from some other sub process in SN. The issue ended up being with the JSON being set as the message content. Once I corrected the JSON, it began working. Found the typo when I was advised to use the set string parameter method instead of set request body.

 

This is a big DOH! on my behalf.