Add error handling when setting up certificate/private key files