pem can be a path to a certificate file or an object that responds to read.