Amazon RDS のドキュメント (http://aws.amazon.com/rds/faqs/#53) には、「Amazon RDS は [MySQL] DB インスタンスごとに SSL 証明書を生成する」と明記されています。証明書を見つける方法に関するドキュメントを見つけることができず、管理コンソールのどこにも証明書が見つかりません。
証明書はどこにありますか?
Amazon RDS のドキュメント (http://aws.amazon.com/rds/faqs/#53) には、「Amazon RDS は [MySQL] DB インスタンスごとに SSL 証明書を生成する」と明記されています。証明書を見つける方法に関するドキュメントを見つけることができず、管理コンソールのどこにも証明書が見つかりません。
証明書はどこにありますか?
ここで解決策を見つけました: https://forums.aws.amazon.com/thread.jspa?threadID=62110。
curl -O https://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem
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> ALTER USER 'username'@'host|%' REQUIRE SSL
AWS RDS 証明書ファイルの情報は、AWS ドキュメント ガイド自体から取得できます。
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MySQL.html
証明書のダウンロードはこちらから
https://rds.amazonaws.com/doc/mysql-ssl-ca-cert.pem
更新 - Amazon が 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
どこ
awssathish.xxyyzz.eu-west-1.rds.amazonaws.com
は RDS のエンドポイント、
awssathish
rds サーバーのユーザー名です。
http://aws-blog.io/2016/rds-over-ssl/を使用 しました。リージョンのルート pem と pem を取得し、2 つのファイルを 1 つに連結する必要があります。 https://s3.amazonaws.com/rds-downloads/rds-ca-2015-us-west-2.pem https://s3.amazonaws.com/rds-downloads/rds-ca-2015-root.pem
ファイルをマージして、単一の rds-ca-2015-us-west-2-bundle.pem ファイルを作成します。--ssl-ca を指定すると、pem ファイルへのフル パスが提供されます。