title: reactor.netty.http.client.HttpClient as builder to create multiple function with different configs
body: <p>Here I am creating a web client builder using HttpClient. How to create HttpClient builder to configure multiple configs on same httpclient. For example: in one function I am creating httpClient with proxy and in 2nd example with proxy and security. SO I called first proxy function which apply proxy and then security on top of httpclient object to get htttpclient object with proxy and security. But its not working as expected. Instead I am getting error</p>
  <blockquote>
  <p>((TcpClientConnect)((TcpClientBootstrap)((HttpTcpClient)((HttpClientConnect)httpClient).defaultClient).defaultClient).source).provider
  = Cannot find local variable 'httpClient'</p>
  </blockquote>
  <p>Can anyone help to fix this issue?</p>
  <pre><code>Class WebClientBuilderConfig{  
    private HttpClient httpClient;
     @Autowired
      private ConfigProperties configProperties;
  
      public WebClientBuilderConfig() {
          this.httpClient = HttpClient.create();
      }
  
  
      public WebClient.Builder webClientBuilderWithProxy() {
          Function&lt;String, String&gt; httpsProxyPassword = username -&gt; configProperties.getHttpsProxyPassword();
          this.httpClient.tcpConfiguration(tcpClient -&gt; tcpClient.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, configProperties.getTcpTimeout())
                  .doOnConnected(conn -&gt; conn.addHandlerLast(new ReadTimeoutHandler(configProperties.getTcpTimeout(), TimeUnit.MILLISECONDS)))
                  .proxy(proxy -&gt; proxy.type(ProxyProvider.Proxy.HTTP)
                          .host(configProperties.getHttpsProxyHost())
                          .port(configProperties.getHttpsProxyPort())
                          .nonProxyHosts(configProperties.getHttpsNonProxyHost())
                          .username(configProperties.getHttpsProxyUser())
                          .password(httpsProxyPassword)))
                  .wiretap(configProperties.getTcpWireTap());
          return WebClient.builder().clientConnector(new ReactorClientHttpConnector(httpClient));
      }
  
      public WebClient.Builder webClientBuilderWithSSL() {
          **this.webClientBuilderWithProxy();**
          // truststore
          try {
              KeyStore trustStore = KeyStore.getInstance(configProperties.getTrustStoreType());
              trustStore.load(new FileInputStream((ResourceUtils.getFile(configProperties.getTrustStorePath()))),
                      configProperties.getTrustStorePassword().toCharArray());
  
              TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
              trustManagerFactory.init(trustStore);
  
              SslContext sslContext = SslContextBuilder.forClient().trustManager(trustManagerFactory).build();
  
              httpClient.secure(spec -&gt; spec.sslContext(sslContext));
          } catch (Exception e) {
              log.warn(&quot;Unable to set SSL Context&quot;, e);
          }
  
          return WebClient.builder().clientConnector(new ReactorClientHttpConnector(this.httpClient));
      }
  </code></pre>