Refactor internal logic to support optional request params (like for domains with self-signed certificate)