1

我想设置从我的 Ubuntu 服务器到引擎版本为 5.7 的 Aurora Serverless MySQL 的加密连接,但是默认情况下,该服务上似乎禁用了 SSL。

show variables like '%ssl%';
| Variable_name | Value
                                                                                                                                                                                                                                                                                                
| have_openssl  | DISABLED                                                                                                                                                                                                                                                                                             |
| have_ssl      | DISABLED                                           

这与 Aurora RDS 不同,后者使用 SSL 非常简单且默认启用。

这是错误:

mysql -h <cluster-endpoint> -u <username> -p --ssl-ca=rds-ca-2019-us-east-1-bundle.pem
Enter password:
ERROR 2026 (HY000): SSL connection error: error:00000001:lib(0):func(0):reason(1)

mysql客户端版本

mysql  Ver 14.14 Distrib 5.7.31, for Linux (x86_64) using  EditLine wrapper

参数组设置为默认设置。

该错误似乎与此处解决的错误相似,但消息完全不同。

https://aws.amazon.com/premiumsupport/knowledge-center/rds-error-2026-ssl-connection/

Serverless 文档的 TLS/SSL 似乎表明 RDS 和 Serverless 的用法基本相同。

https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html#aurora-serverless.tls

我几乎是一个数据库新手,任何故障排除帮助将不胜感激。

4

1 回答 1

1

关于 Aurora Serverless,您需要了解两件重要的事情。

  1. 强烈推荐使用 SSL,它是建立新连接的首选。所以你不需要对此做任何事情。您绝对不需要下载 SSL/TLS 证书,事实上您也不应该。让证书在 Aurora 上轮换和管理。它让你的生活更简单。

  2. 根据官方文档 [1] - 检查have_openssl是否have_ssl正确使用 SSL 来验证您的连接。您需要使用--ssl-mode参数来验证这一点。

[1] https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html#aurora-serverless.tls

您可以确保您的会话在您的客户端和 Aurora Serverless VPC 终端节点之间使用 TLS。为此,请使用 --ssl-mode 参数在客户端指定要求。

于 2020-11-23T05:22:19.197 回答