change config.elasticsearch to optionally be an object with server/withCredentials option