aws js sdk -- unable to get local issuer certificate in local node script, but works just fine with aws cli

30 views Asked by At

I am writing a helper to enable running a lambda function locally. There are DynamoDB and other calls to AWS services in this function. When I run my script, the aws-sdk says it cannot get the local issuer certifcate.

Error: unable to get local issuer certificate
    at TLSSocket.onConnectSecure (node:_tls_wrap:1558:34)
    at TLSSocket.emit (node:events:512:28)
    at TLSSocket.emit (node:domain:489:12)
    at TLSSocket._finishInit (node:_tls_wrap:977:8)
    at ssl.onhandshakedone (node:_tls_wrap:771:12)
    at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
  code: 'NetworkingError',
  region: <myregion>,
  hostname: 'dynamodb.<myregion>.amazonaws.com',
  retryable: true,
  time: 2024-03-06T16:08:09.372Z
}

However, when I make a request via the aws cli, such as aws s3 ls it works perfectly. I have the AWS_CA_BUNDLE env var set in my shell, and I know it works because when I unset it, the cli fails.

Does anybody know why my script might be behaving in one way, but the cli in another? The script is reading the other AWS environment variables just fine.

Thank you in advance!

0

There are 0 answers