【发布时间】:2020-10-12 23:32:39
【问题描述】:
是否可以在 AWS ELB 上终止 SSL 到 Postgres 服务器的前面,以使以下命令成功?
PGSSLMODE=verify-full \
PGSSLROOTCERT=/path/to/go-daddy-root-ca.pem \
PGCONNECT_TIMEOUT=5 \
psql -h my-postgres.example.com -p 5432 -U test_username test-database -c 'select 1';
如果我使用以下参数在 Postgres 服务上设置我的 ssl 证书和密钥,我可以在负载均衡器上使用 TCP 协议,并在实例协议上使用 TCP:
-c
ssl=on
-c
ssl_cert_file=/var/lib/postgresql/my-postgres.example.com.crt
-c
ssl_key_file=/var/lib/postgresql/my-postgres.example.com.key
但是,如果可能,我想在负载均衡器级别处理 SSL,以免将证书和密钥传递到运行 postgres 服务的实例中。我尝试了以下 ELB 配置:
LB Proto、Instance Proto、Postres SSL、成功/失败
TCP,TCP,开启,成功
SSL、TCP、开启、失败
TCP,SSL,开启,失败
SSL,SSL,开启,失败
SSL、TCP、关闭、失败
失败信息如下:
psql: error: could not connect to server: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
也许 NLB 会起作用,也许在 Postgres 服务级别终止 SSL 端到端是 verify-full 成功的唯一方法?
如果它有助于替代方法,postgres 正在 EKS 集群中运行。
感谢您提供的任何信息!
【问题讨论】:
标签: postgresql amazon-web-services ssl amazon-elb amazon-eks