MySQL 和 AWS 文档中的 PostgreSQL (boto3) 调用给出的 SSL 证书颁发机构的“[完整路径]”组件是什么?

What is the "[full path]" component of the SSL Certificate Authority given by MySQL and PostgreSQL (boto3) calls in the AWS docs?

在“Connecting to your DB instance using IAM authentication and the AWS SDK for Python (Boto3)”的 AWS 文档中,对 psycopg2.connect(显示)和 mysql.connector.connect 进行了以下调用:

conn = psycopg2.connect(host=ENDPOINT, port=PORT, database=DBNAME, user=USR, password=token, sslmode='prefer', sslrootcert="[full path]rds-combined-ca-bundle.pem")
cur = conn.cursor()
cur.execute("""SELECT now()""")
query_results = cur.fetchall()
print(query_results)

我看到一些关于 ssl_ca 路径的讨论(here and here) and what those bundles are used for. But none of the three links I've given here describe the [full path] component given by the AWS docs, or where it is pointing to. My current guess (from the second link) is this URL,但我想确定一下。

此外,将这个包下载到远程 EC2 有什么好处,这些 Python 3 (boto3) 脚本是 运行?

编辑:顺便说一句,上面对 psycopg2.connect 的调用正在 Jupyter 中使用 Python 3.9.5 目前在 EC2 上工作,[full path] 按原样编写。 ..

您应该将“[完整路径]”替换为将 pem 文件下载到本地计算机时保存 pem 文件的文件系统路径(目录路径)(从您提供的最后一个 URL) .

使用它的好处是您的客户端将验证它连接到正确的数据库,而不是拦截您的流量的某些恶意系统。我不知道你认为这有多有利:如果有人已经破坏了 Amazon 足以拦截他们的内部流量,他们也可能已经破坏了他们的 CA。但至少有可能他们只做了一个而没有另一个。

您显示的代码对我不起作用,因为 ssl_ca 不是它的拼写方式。假设您使用了第一次 link 为 PostgreSQL 实际给出的代码:

sslmode='prefer', sslrootcert="[full path]rds-combined-ca-bundle.pem"

那么尽管路径是伪造的但它仍然有效的原因是“更喜欢”意味着它不关心是否缺少 rootcert,它只是在这种情况下跳过验证。如果您将其更改为 'verify-full',那么它可能会停止工作。