Refactoring: use app settings to store certificate location and let user pass in the certificate