We want to integrate our internal product(on premise) with Freshservice. While using the request API to connect to our server which is configured with self signed SSL certificate, the following error response is received.
Response Received:
{“status”:502,“headers”:{},“response”:“Error in establishing connection”,“errorSource”:“APP”,“attempts”:1}
Thank you for the reply. Why can’t I connect to my server which is configured with Self Signed Certificate using the Request API? Should I do any additional configurations to communicate with my server (with self signed SSL certificate)?
The first thought I had when I saw your question is if the certificate is also installed in the machine which is running the FDK. The issue with self certified SSL servers is that the certificate is (most of times) only installed in a single machine. Maybe it could be the issue. Could you confirm if the certificate is present in both of the machines keychains? If this doesn’t work, do reply and we will figure something out together.
For custom apps, i.e., apps intalled only on your account, you will not publish it on marketplace, it’s possible to use third party libs for requests. So you can try use unirest
In this lib, it’s possible to disable the certificate verification:
Request.strictSSL(Boolean)
Sets strictSSL flag to require that SSL certificates be valid on Request.options based on given value.
So declare the lib on manifest.json and try the code:
var unirest = require("unirest");
var req = unirest("GET", "url")
.headers({
Accept: "application/json",
})
.strictSSL(false)
.end(function(res) {
if (res.error) {
console.error(res.error);
} else {
console.log(res.raw_body);
}
});