ssl - 如何通过 SSL 连接使用 Alembic?

标签 ssl alembic

我使用 Alembic 来管理我的迁移。我的数据库位于 AWS 上,我想使用 SSL 连接它。

在我的 alembic.ini 中,我有以下几行

[production]
script_location = alembic_prod
sqlalchemy.url = mysql+pymysql://user:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="93e3f2e0e0e4fce1f7d3feeabee1f7e0befbfce0e7bdf6e6bee4f6e0e7bea2bde1f7e0bdf2fef2e9fcfdf2e4e0bdf0fcfe" rel="noreferrer noopener nofollow">[email protected]</a>/mydatabase

当然,如果用户有权在不使用 SSL 的情况下连接底座,则可以使用,否则不行。

如何要求 SSL 连接,并指定 certificate

最佳答案

您首先需要证书 bundle -

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MySQL.html#MySQL.Concepts.SSLSupport

然后,您可以将适当的参数添加到您的 URL,如下所示 -

How to connect to mysql server with SSL from a flask app

关于ssl - 如何通过 SSL 连接使用 Alembic?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46317055/

相关文章:

python - sqlalchemy - alembic 运行更新查询而不指定模型以避免以后的迁移冲突

python - 将多个迁移压缩为一个

php - 在 nodejs 和 php 之间共享 cookie

WCF SSL 服务提供 404 未找到

java - 使用 Google Dataflow 上的 KafkaIO 通过 SSL 连接到 Kafka

php - 未启用 PHP 中的套接字传输 "ssl"

ssl - 如何在 Go 中的 TLSClient 中使用 http.Get?

python - SQLAlchemy、Alembic 和新实例

python - Unicode 与 Alembic 不一致

Python - 使用 Setuptools 打包 Alembic 迁移