如何获取亚马逊MySQL RDS证书

29

Amazon RDS文档(http://aws.amazon.com/rds/faqs/#53)指定“Amazon RDS为每个[MySQL] DB实例生成SSL证书”。我无法找到任何有关如何查找证书的文档,并且在管理控制台中找不到证书。

证书在哪里?

3个回答

28

我在这里找到了解决方案:https://forums.aws.amazon.com/thread.jspa?threadID=62110

  • 此处下载ca证书文件。

curl -O https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem

  • 连接到mysql:
mysql -uusername -p --host=host --ssl-ca=mysql-ssl-ca-cert.pem
  • 检查您的连接是否真正加密:
mysql> SHOW STATUS LIKE 'Ssl_cipher';
+---------------+------------+
| 变量名          | 值         |
+---------------+------------+
| Ssl_cipher    | AES256-SHA |
+---------------+------------+
1 行记录(0.00 秒)
  • 强制要求MySQL中特定用户使用SSL连接(可选)

mysql> ALTER USER 'username'@'host|%' REQUIRE SSL


1
对于那些可能遇到相同问题的人,我的.pem文件路径失败了,因为我有一个(例如/Downloads/mysql-ssl-ca-cert.pem)。必须执行--ssl_ca=/Users/myusername/Downloads/mysql-ssl-ca-cert.pem。 ~的错误是:ERROR 2026(HY000):SSL连接错误:ASN:坏的其他签名确认。 - jlpp
1
亚马逊的证书已于2015年4月4日过期,我无法看到任何更新。如果有人有新的URL,请分享。 - igorsales
2
是的,我刚刚从这个地址更新了证书:http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html - Richard Caetano

5
您可以从AWS文档指南中获取AWS RDS证书文件信息。 http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MySQL.html 从这里下载证书 https://rds.amazonaws.com/doc/mysql-ssl-ca-cert.pem 更新 - 亚马逊已更新SSL证书,您可以从这里下载: https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem 使用以下命令登录mysql。
root@sathish:/usr/src# mysql -h awssathish.xxyyzz.eu-west-1.rds.amazonaws.com -u awssathish -p --ssl-ca=mysql-ssl-ca-cert.pem
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 22
Server version: 5.6.13-log MySQL Community Server (GPL)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
mysql> GRANT USAGE ON *.* TO ‘awssathish’@’%’ REQUIRE SSL
Query OK, 0 rows affected (0.02 sec)
mysql> 
mysql> show variables like "%ssl";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| have_openssl  | YES   |
| have_ssl      | YES   |
+---------------+-------+
2 rows in set (0.00 sec)
mysql> 
mysql> SHOW STATUS LIKE 'Ssl_cipher';
+---------------+------------+
| Variable_name | Value      |
+---------------+------------+
| Ssl_cipher    | AES256-SHA |
+---------------+------------+
1 row in set (0.01 sec)

mysql> exit
Bye

这里是关于RDS的端点信息:

awssathish.xxyyzz.eu-west-1.rds.amazonaws.com 是RDS的端点地址,

awssathish 是RDS服务器的用户名。


证书已于2015年4月4日过期。如果有新的证书URL,请分享。 - igorsales
1
添加了新的SSL证书链接。 - Sathish

1

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接