Is there any chance you (by accident) have switched around the two files, "cert.pem and “key.pem”, and therefore are loading the key as being the certificate, and the certificate as being the key?
Is the cert.pem file starting with “-----BEGIN CERTIFICATE-----” and ending with “-----END CERTIFICATE-----”?
Is the key.pem file starting with “-----BEGIN PRIVATE KEY-----” and ending with “-----END PRIVATE KEY-----”?