gpt4 book ai didi

PostgreSQL pgAdmin III SSL 连接到 AWS RDS 实例

转载 作者:行者123 更新时间:2023-11-29 11:25:53 26 4
gpt4 key购买 nike

我正在尝试使用 SSL 连接到在 AWS(亚马逊网络服务)上运行的 RDS。我在 PosgreSQL pgAdmin III 文档中看到了关于 SSL 选项卡上字段的有限信息。

RDS instances are setup to accept SSL connections by default.

我已经从 Amazon 下载公钥并使用 openSSL 将其从 .pem 文件转换为 .crt 文件。在 pgAdmin III 的 SSL 选项卡上,我输入了转换 key 文件的路径“服务器根证书文件”字段。

我可以毫无问题地连接到实例但没有迹象表明数据正在通过 SSL 传输AWS 没有将他们的 RDS 实例设置为独占使用 SSL 所以我可能在不使用 SSL 的情况下连接并且不知道它。

pgAdmin III 在使用 SSL 连接时是否显示任何指示(如锁图标)?任何人都可以在 pgAdmin III 的 SSL 选项卡上提供描述字段(SSL 下拉列表、客户端证书文件、客户端 key )的其他信息吗?

谢谢。

最佳答案

我没有在 AWS 上将 SSL 与 PGAdmin 一起使用,但我在服务器上使用过,我可以告诉你,你知道什么时候通过 PGAdmin 连接到服务器,我不确定那里有什么歧义,可以你看到数据库、表了吗?

下面引用的帖子可能会帮助您通过 SSL 连接到服务器。

On the client, we need three files. For Windows, these files must be in %appdata%\postgresql\ directory. For Linux ~/.postgresql/ directory. root.crt (trusted root certificate) postgresql.crt (client certificate) postgresql.key (private key)

Generate the the needed files on the server machine, and then copy them to the client. We'll generate the needed files in the /tmp/ directory.

First create the private key postgresql.key for the client machine, and remove the passphrase.

openssl genrsa -des3 -out /tmp/postgresql.key 1024

openssl rsa -in /tmp/postgresql.key -out /tmp/postgresql.key

Then create the certificate postgresql.crt. It must be signed by our trusted root (which is using the private key file on the server machine). Also, the certificate common name (CN) must be set to the database user name we'll connect as.

openssl req -new -key /tmp/postgresql.key -out /tmp/postgresql.csr -subj '/C=CA/ST=British Columbia/L=Comox/O=TheBrain.ca/CN=www-data'

openssl x509 -req -in /tmp/postgresql.csr -CA root.crt -CAkey server.key -out /tmp/postgresql.crt -CAcreateserial

Copy the three files we created from the server /tmp/ directory to the client machine.

Copy the trusted root certificate root.crt from the server machine to the client machine (for Windows pgadmin %appdata%\postgresql\ or for Linux pgadmin ~/.postgresql/). Change the file permission of postgresql.key to restrict access to just you (probably not needed on Windows as the restricted access is already inherited). Remove the files from the server /tmp/ directory.

发件人:http://www.howtoforge.com/postgresql-ssl-certificates

关于PostgreSQL pgAdmin III SSL 连接到 AWS RDS 实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23525363/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com