简体   繁体   English

Postgresql-100%确定与服务器使用SSL连接吗?

[英]Postgresql - 100% sure to use SSL connection with server?

是否可以检查(非root用户/ SQL问题)以检查我从客户端到服务器的连接是否使用SSL(我的目标服务器cas既使用安全连接又使用非安全连接)?

as of 9.5: 从9.5开始:

https://www.postgresql.org/docs/current/static/monitoring-stats.html#PG-STAT-SSL-VIEW https://www.postgresql.org/docs/current/static/monitoring-stats.html#PG-STAT-SSL-VIEW

The pg_stat_ssl view will contain one row per backend or WAL sender process, showing statistics about SSL usage on this connection. pg_stat_ssl视图将在每个后端或WAL发送者进程中包含一行,显示有关此连接上SSL使用情况的统计信息。 It can be joined to pg_stat_activity or pg_stat_replication on the pid column to get more details about the connection. 可以将其连接到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     |            | {}        |

the above shows my connection is not SSL 上面显示我的连接不是SSL

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM