Add ssl to ws only if needed.