accept .pem as certificate file
remove bashisms