unable to get local issuer certificate request while generating access tokens for AEM as a Cloud Service | Community
Skip to main content
aanchal-sikka
Community Advisor
Community Advisor
February 28, 2023
Solved

unable to get local issuer certificate request while generating access tokens for AEM as a Cloud Service

  • February 28, 2023
  • 1 reply
  • 5028 views

Hello,

 

I am trying to generate access tokens for an AEM as a Cloud Service Instance. Found this client lib provided by Adobe that uses Service Credentials to generate Access Tokens. https://github.com/adobe/aemcs-api-client-lib

 

On executing it, I am getting following error

 

However, if I extract the JWT from the same response and request access_token via curl, the request is successful.

 

Requesting guidance on what I might be missing, when executing https://github.com/adobe/aemcs-api-client-lib 

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by nitesh_kumar-1

I'm glad that it worked.

 

Another possible approach would be to download the certificate for the IMS endpoint and enforce nodeJS to use it.

Check if there are any network restrictions on your machine, also check with the newer node version.

 

You could also open an issue here if it's a generic windows based issue then something needs to be changed there.

https://github.com/adobe/aemcs-api-client-lib  

 

1 reply

nitesh_kumar-1
Adobe Employee
Adobe Employee
February 28, 2023

Hi @aanchal-sikka ,

 

Looks like system specific error, and precisely with NodeJs,

have you checked these threads already (also other related to Nodejs-specific issues)

https://stackoverflow.com/questions/68111460/error-unable-to-get-local-issuer-certificate 

 

FYI,

on my macOs Ventura, 

node version - v14.18.0

I am able to retrieve the token.

 

Also, check if it's not the VPN or some network causing this issue. Sometimes it's a temporary glitch you could also try after some time.

 

Hope that helps!

 

Regards,

Nitesh

aanchal-sikka
Community Advisor
Community Advisor
March 1, 2023

Thanks for sharing @nitesh_kumar-1 

 

As you suggested, it is occurring as NodeJS is rejecting invalid/unauthorized certificates.

I was able to resolve this by appending following to index.js

process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
 
Its a temporary fix. Though was wishing for a permanent one, as in how we can fix it on certificate level
Aanchal Sikka
nitesh_kumar-1
Adobe Employee
nitesh_kumar-1Adobe EmployeeAccepted solution
Adobe Employee
March 1, 2023

I'm glad that it worked.

 

Another possible approach would be to download the certificate for the IMS endpoint and enforce nodeJS to use it.

Check if there are any network restrictions on your machine, also check with the newer node version.

 

You could also open an issue here if it's a generic windows based issue then something needs to be changed there.

https://github.com/adobe/aemcs-api-client-lib