Removed naming confusion, fixed optional SSL logic