【问题标题】:TLSv1.2 on Azure PostgreSQL ServerAzure PostgreSQL 服务器上的 TLSv1.2
【发布时间】:2019-09-30 11:04:38
【问题描述】:

我正在尝试确保 PostgreSQL 客户端与 Azure PostgreSQL 服务器(版本 10.7)的连接使用的是 TLSv1.2。当我执行psql 命令时,连接头显示协议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.1cipher 信息也不相同。

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

【问题讨论】:

    标签: postgresql azure ssl tls1.2


    【解决方案1】:

    看来这个问题是微软自己解决的

    [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 版本已正确返回。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多