A certificate check would be useful.
re: https://nagios-plugins.org/doc/man/check_http.html
This URL indicates there is a starttls command:
https://dba.stackexchange.com/questions/108710/how-to-examine-postgresql-servers-ssl-certificate
e.g. openssl s_client -starttls postgres -connect pg03.example.org:5432