[英]Connection error in AWS RDS SSL in NodeJS
我正在嘗試使用 SSL 通過 Lambda NodeJS 12.x 連接到 RDS。 但是我收到這些錯誤:
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'
我是這樣連接的:
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
});
當我通過 MySql Workbench 與證書連接時,一切正常。
關於如何解決這個問題的任何想法?
非常感謝!
問題與 Mysql 版本和 TLS 版本有關。 此矩陣顯示 MySQL 5.6 僅支持 TLS 1.0。 Node.js 12 默認使用 TLS 1.2。
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MySQL.html#MySQL.Concepts.SSLSupport
在連接之前執行此操作,因為它對文件的權限不足
sudo chmod 755 rds-combined-ca-bundle.pem
警告:保持一個強密碼,這個密碼很容易被猜到
如果問題仍然存在,請檢查IAM 對lambda 的權限或檢查RDS 和lambda 是否在同一VPC 中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.