Skip to content

Amplify mock fails to use SSL certificate for postgres connect #68

Open
@gouthasnm

Description

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

14.18.3

Amplify CLI Version

7.6.26

What operating system are you using?

Amazon Linux

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

None

Amplify Categories

function

Amplify Commands

Not applicable

Describe the bug

amplify mock function fails with

{
stack: 'Error: unable to get local issuer certificate\n' +
' at TLSSocket.onConnectSecure (_tls_wrap.js:1515:34)\n' +
' at TLSSocket.emit (events.js:400:28)\n' +
' at TLSSocket.emit (domain.js:475:12)\n' +
' at TLSSocket._finishInit (_tls_wrap.js:937:8)\n' +
' at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:709:12)',
message: 'unable to get local issuer certificate',
code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY'
}

Expected behavior

Should be able to use SSL.

Reproduction steps

const signerOptions = {
    hostname: DB_HOST,
    region: "us-east-1",
    port: DB_PORT,
    username: DB_USER
}

const signer = new AWS.RDS.Signer(signerOptions)

const token = await signer.getAuthToken();
const client = await new Client({
    user: DB_USER,
    host: DB_HOST,
    database: 'postgres',
    password: token,
    port: DB_PORT,
    ssl: require
}).connect();

GraphQL schema(s)

NA

Log output

# Put your logs below this line


Additional information

None

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions