varamyr | 2023-07-21 10:52:39 UTC | #1
Hi, I am facing the following error when I am trying to use Platform API through Node.JS AxiosError: unable to get local issuer certificate at TLSSocket.onConnectSecure (node:tlswrap:1550:34) at TLSSocket.emit (node:events:514:28) at TLSSocket.finishInit (node:tlswrap:967:8) at ssl.onhandshakedone (node:tlswrap:743:12) { code: 'UNABLETOGETISSUERCERTLOCALLY', config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false },..
Following is the code which is giving me an error // Obtain a reference to the platformClient object const platformClient = require('purecloud-platform-client-v2');
const clientId = "my-client-id" const clientSecret = "my-client-secret"
const client = platformClient.ApiClient.instance;
client.loginClientCredentialsGrant(clientId,clientSecret).then(()=> { // Do authenticated things console.log("Authenticated"); }) .catch((err) => { // Handle failure response console.log("fail"); console.log(err); });
The API with the same client ID & client Secret is working when I am invoking it through Postman Am I doing anything wrong, please help
tim.smith | 2023-07-21 13:58:01 UTC | #2
This sounds like your local machine is having trouble managing its SSL certs; there is no specific configuration done for this under normal circumstances. This can be caused by invasive tooling your IT department may have installed on your machine to block DNS, intercept network traffic, or manage SSL certs. Working with your company's IT group to diagnose your machine's handling of SSL certs should be a good next step.
system | 2023-08-21 13:58:16 UTC | #3
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 21106