Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

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

Avatar

Community Advisor

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

aanchalsikka_0-1677579918054.png

 

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

aanchalsikka_1-1677579999376.png

 

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

 

 

 


Aanchal Sikka

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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  

 

View solution in original post

3 Replies

Avatar

Employee Advisor

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

Avatar

Community Advisor

Thanks for sharing @nitesh_kumar 

 

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

Avatar

Correct answer by
Employee Advisor

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