@Override
  protected void updateContext(final ProxyRepository repository, final RemoteStorageContext ctx)
      throws RemoteStorageException {
    // reset current http client, if exists
    ctx.removeContextObject(CTX_KEY_CLIENT);
    ctx.removeContextObject(CTX_KEY_S3_FLAG);
    httpClientManager.release(repository, ctx);

    try {
      // and create a new one
      final HttpClient httpClient = httpClientManager.create(repository, ctx);
      ctx.putContextObject(CTX_KEY_CLIENT, httpClient);
      // NEXUS-3338: we don't know after config change is remote S3 (url changed maybe)
      ctx.putContextObject(CTX_KEY_S3_FLAG, new BooleanFlagHolder());
    } catch (IllegalStateException e) {
      throw new RemoteStorageException("Could not create HTTPClient4x instance!", e);
    }
  }