I'm playing around with SSL connections to a test postgres server and I'm finding I can still initiate an SSL connection despite invalid certificates. (The valid date has expired)
I have enforced SSL connections in the pg_hba.conf
## pg_hba.conf - SSL TESTING
hostssl mike mike 192.168.56.106/32 md5
SSL Certificate is expired:
$ openssl x509 -in server.crt -noout -dates
notBefore=Feb 22 18:29:39 2019 GMT
notAfter=Feb 23 18:29:39 2019 GMT
Still able to connect via SSL:
postgres:/db/postgresql/10/data>psql "sslmode=require host=192.168.56.105 dbname=mike user=mike"
Password:
psql (10.7)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.
mike=>
Why can I still connect?
I'm hoping for a situation where the connection is rejected because the certificate is invalid - am I missing something? Any help appreciated :)