Fixed logic behind "rejectUnauthorized" property in request
Updated version