It should be an error for one of these to be empty, so wrap both creates in the same if statement? (`len(cert) > 0 && len(key) > 0`)