【问题标题】:How to get hold of Amazon MySQL RDS certificates如何获取 Amazon MySQL RDS 证书
【发布时间】:2011-09-21 18:10:51
【问题描述】:

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

证书在哪里?

【问题讨论】:

    标签: mysql amazon-rds


    【解决方案1】:

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

    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 秒)
    • 可选择强制特定用户使用 SSL 连接到 MySQL

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

    【讨论】:

    • 对于那些可能遇到同样问题的人,只要我有一个 ~(例如 ~/Downloads/mysql-ssl-ca-cert.pem),我的 .pem 文件的路径就会失败。不得不做--ssl_ca=/Users/myusername/Downloads/mysql-ssl-ca-cert.pem。 〜错误是:错误2026(HY000):SSL连接错误:ASN:其他签名确认错误
    • 亚马逊的证书已于 2015 年 4 月 4 日到期,我看不到任何更新。如果有人有新的网址,请分享。
    • 是的,我刚刚从这个地址更新了证书:docs.aws.amazon.com/AmazonRDS/latest/UserGuide/…
    【解决方案2】:

    您可以从 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
    

    在哪里

    awssathish.xxyyzz.eu-west-1.rds.amazonaws.com

    是RDS的端点,

    无所适从

    是rds服务器的用户名

    【讨论】:

    • 证书已于2015年4月4日到期。如果有新的证书网址,请分享。
    • 添加了新的 SSL 证书链接。
    【解决方案3】:

    我用http://aws-blog.io/2016/rds-over-ssl/ 您必须获取该区域的根 pem 和 pem 并将 2 个文件合并为一个。 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 文件的完整路径。

    【讨论】:

      猜你喜欢
      • 2020-02-15
      • 2020-03-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-06
      • 2015-04-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多