是否可以检查(因为没有root用户/ SQL问题)来检查,如果我从客户端到服务器的连接使用SSL(我的目标服务器cas使用两者 - 安全连接和非安全连接)?
答案 0 :(得分:4)
截至9.5:
https://www.postgresql.org/docs/current/static/monitoring-stats.html#PG-STAT-SSL-VIEW
pg_stat_ssl视图将包含每个后端或WAL发送方一行 进程,显示有关此连接上的SSL使用情况的统计信息它可以 加入pid列上的pg_stat_activity或pg_stat_replication 获取有关连接的更多详细信息。
t=# set role notsu ;
SET
Time: 9.289 ms
t=> select * from pg_stat_ssl where pid = pg_backend_pid();
pid | ssl | version | cipher | bits | compression | clientdn
-------+-----+---------+--------+------+-------------+----------
43767 | f | | | | |
(1 row)
Time: 10.846 ms
t=> \du+ notsu
List of roles
Role name | Attributes | Member of | Description
-----------+------------+-----------+-------------
notsu | | {} |
以上显示我的连接不是SSL