If you don't care about hostname verification while still wanting to use a certificate, you can use the additional parameter sslmode=verify-ca as a connection parameter or as part of the URL to disable hostname verification while retaining certificate verification.