Skip to content

Update TLS certs for Amazon RDS instances #2130

Closed
@ls-pieter-vanisacker

Description

@ls-pieter-vanisacker

It seems like the current version, 3.5.1 is unable to connect successfully to RDS instances using the rds-ca-rsa2048-g1 certificate authority.

Example code:

// get the client
const mysql = require('mysql2');

// create the connection to database
const connection = mysql.createConnection({
  host: 'xyz.c8dqrcnbng7v.eu-west-1.rds.amazonaws.com',
  port: 3306,
  user: 'abc',
  password: 'abc',
  database: 'information_schema',
  ssl: "Amazon RDS"
});

// simple query
connection.query(
  'show tables;',
  function(err, results, fields) {
    console.log(results); // results contains rows returned by server
    console.log(fields); // fields contains extra meta data about results, if available
  }
);

Throws the following:

undefined
undefined
Error: unable to get local issuer certificate
    at TLSSocket.onConnectSecure (node:_tls_wrap:1539:34)
    at TLSSocket.emit (node:events:513:28)
    at TLSSocket._finishInit (node:_tls_wrap:953:8)
    at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:734:12) {
  code: 'HANDSHAKE_SSL_ERROR',
  fatal: true
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions