RDS SSL error

0

Hi,

I am trying to connect to RDS through Lambda NodeJS 12.x with SSL. However I am receiving these errors:

  Error: 4506652096:error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol:
  library: 'SSL routines',
  function: 'ssl_choose_client_version',
  reason: 'unsupported protocol',
  code: 'HANDSHAKE_SSL_ERROR'

I am connecting like this:

const pool  = mysql.createPool({
  connectionLimit     : 10,
  host                : 'db.cqgcxllqwqnk.eu-central-1.rds.amazonaws.com',
  ssl                 : {
    ca                : fs.readFileSync(__dirname + '/rds-ca-2019-root.pem')
  },
  user                : ‘xxxxx’,
  password            : ‘xxxxxx’,
  database            : ‘xxxxxx’,
  multipleStatements  : true
});

When I connect with the certificate through MySql Workbench everything works just fine.

Any idea on how to solve this?

Thanks a lot!

KasperS
질문됨 4년 전498회 조회
4개 답변
0

Hi,

Ensure that your Lambda function has the necessary role attached to it, to be allow it connect to the RDS instance located in your VPC [1].

Also make sure that the client's certificate matches the database instances certificate, in your case the rds-ca-2019 is being used with the lambda, the RDS instance should also make user of this certificate. If your instance was launched after 14 January 2020 it would already have the latest certitifcate [2]

Hope this is of some help
/MrK

References:
[1] https://docs.aws.amazon.com/lambda/latest/dg/services-rds-tutorial.html
[2] https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL-certificate-rotation.html

MrK
답변함 4년 전
0

Hi MrK,

Thank you for your reply. Unfortunately those are not the issues as I can connect just fine without SSL and the database is updated to use the new certificate. As mentioned I connect with that certificate just fine through MySQL WorkBench.

KasperS
답변함 4년 전
0

I am experiencing the same issue, did you get it resolved?

답변함 4년 전
0

The MySQL version was too old, needed to upgrade (I upgraded to 8)

KasperS
답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인