postgresql - Azure PostgreSQL 服务器上的 TLSv1.2

标签 postgresql azure ssl tls1.2

我尝试确保 PostgreSQL 客户端与 Azure PostgreSQL 服务器(版本 10.7)的连接使用 TLSv1.2。当我执行 psql 命令时,连接 header 显示协议(protocol) TLSv1.2:

[user ~]# psql -h psql_server.postgres.database.azure.com -p 5432 -U psql_admin_accnt@psql_server -W postgres
Password:
psql (10.7)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.

但是,当我查询 pg_stat_ssl 表时,我得到的信息是当前连接正在使用 TLSv1.1 并且 cipher 信息不是'也不一样。

postgres=> SELECT * FROM pg_stat_ssl;
  pid   | ssl | version |        cipher        | bits | compression | clientdn
--------+-----+---------+----------------------+------+-------------+----------
 168648 | t   | TLSv1.1 | ECDHE-RSA-AES256-SHA |  256 | f           |
(1 row)

哪一条信息是正确的并且我应该依赖?我的 psql 连接确实使用 TLSv1.2 还是从 PostgreSQL 系统表中看到的 TLSv1.1

最佳答案

看来该问题已由 Microsoft 自行修复

[user@host ~]$ /usr/pgsql-10/bin/psql "host=psql_server.postgres.database.azure.com port=5432 dbname=dbname user=psql_admin_accnt@psql_server sslmode=require sslrootcert=/path/to/BaltimoreCyberTrustRoot.cer"
Password:
psql (10.11)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.

dbname=> SELECT * FROM pg_stat_ssl WHERE pid = pg_backend_pid();
  pid   | ssl | version |           cipher            | bits | compression | clientdn
--------+-----+---------+-----------------------------+------+-------------+----------
 812820 | t   | TLSv1.2 | ECDHE-RSA-AES256-GCM-SHA384 |  256 | f           |
(1 row)

dbname=> SELECT VERSION();
                           version
-------------------------------------------------------------
PostgreSQL 10.11, compiled by Visual C++ build 1800, 64-bit
(1 row)

现在,TLS 版本已正确返回。

关于postgresql - Azure PostgreSQL 服务器上的 TLSv1.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56113151/

相关文章:

azure - 使用 ARM 模板在 cosmos Db 中启用 disableLocalAuth

oracle - 如何使用 SQL 查询查找 Oracle 数据库的 SID

linux - 使用 FTP 在 Azure Web 应用程序上部署 ASP.NET Core 应用程序

postgresql - 通过迁移在 PostgreSQL 数据库中安装扩展而无需 super 用户角色?

node.js - 改变模式内的表 - postgres + sequelize

security - HTTPS 将我重定向到另一个网站

ssl - WebSphere SSL 实现是否依赖于 OpenSSL?

android - 如何避免使用 SSL 信任 killer 应用程序绕过 Okhttp 证书固定?

python - 从 ms sql 迁移到 postgres 非 ascii 字符错误 python

PostgreSQL:SELECT INTO - 如何创建索引?