Search code examples
postgresqlsslpostgresql-9.1psqlodbc

How to check is connection encrypted


Using old Postgres server

PostgreSQL 9.1.2 on x86_64-unknown-linux-gnu, compiled by gcc-4.4.real (Debian 4.4.5-8) 4.4.5, 64-bit

Server has symlinks server.crt and server.key in data directory /var/lib/postgresql/9.1./main and ssl=true in postgresql.conf file.

Server is running in old Debian squeeze.

Client accesses server from Windows 10 using psqlODBC driver with

sslmode=allow

in connection string.

How to verify that connection is encrypted? Is there some command in client or server or can some protocol analyzer used if no easier way?


Solution

  • The correct solution is to upgrade to 9.5 or above and look into the pg_stat_ssl view. That will tell you if and how the connection is encrypted.