one can not use openssl to test ssl connection to postgresql. True?
If you think the problem might be with the certificate itself, then take postgresql out of the loop entirely by installing that certificate to be used by apache (for instance) instead of by postgresql. Then use s_client against apache.