Repository: provectus/kafka-ui
Issue: Version Check Doesn't Use Proxy Settings 
Labels: type/bug
scope/backend
status/accepted

### Issue submitter TODO list

- [X] I've looked up my issue in [FAQ](https://docs.kafka-ui.provectus.io/faq/common-problems)
- [X] I've searched for an already existing issues [here](https://github.com/provectus/kafka-ui/issues)
- [X] I've tried running `master`-labeled docker image and the issue still persists there
- [X] I'm running a supported version of the application which is listed [here](https://github.com/provectus/kafka-ui/blob/master/SECURITY.md)

### Describe the bug (actual behavior)

The version check fails and displays a 'null' version in the UI when the server is running in an environment that requires a proxy for internet access.

Attempts to configure proxy settings using HTTP_PROXY/HTTPS_PROXY environment variables or using http.proxyHost/https.proxyHost properties do not appear to work.

### Expected behavior

Proxy settings should be used in the WebClient that connects to github to obtain the version information and that should then be displayed in the UI

### Your installation details

App is deployed in a Kubernetes cluster running in AWS behind a web proxy for internet access.
App Version: 0.7 - fdd9ad9
Helm Chart Version: 0.7.0
Application config is sensitive and contains nothing but a broker URL.  These are the environment variables used to configure the proxy with fake setting values:

```
    - name: JAVA_OPTS
      value: "-Dhttp.proxyHost=http://example.com -Dhttp.proxyPort:8080 -Dhttps.proxyHost=http://example.com -Dhttps.proxyPort:8080"
    - name: HTTP_PROXY
      value: http://example.com:8080
    - name: HTTPS_PROXY
      value: http://example.com:8080
    - name: http_proxy
      value: http://example.com:8080
    - name: https_proxy
      value: http://example.com:8080
```


### Steps to reproduce

Configure as per above and navigate to the application.  Hover the cursor over the version check which displays a 'null' version value.  No errors in the logs.

### Screenshots

_No response_

### Logs

_No response_

### Additional context

_No response_

Issue comments:
Hello there ben-voss! 👋

Thank you and congratulations 🎉 for opening your very first issue in this project! 💖

In case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. 👀
Hi, thanks for reporting this. Will be fixed within #3881 (to be used with java args via `-DproxyHost`)

Pull request review comments:
let use `new WebClientConfigurator().build()`  here

Patch that resolved the issue:
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/GithubReleaseInfo.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/GithubReleaseInfo.java
index 2ad0c9c399b..26afaa82a2e 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/GithubReleaseInfo.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/GithubReleaseInfo.java
@@ -3,7 +3,6 @@
 import com.google.common.annotations.VisibleForTesting;
 import java.time.Duration;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.reactive.function.client.WebClient;
 import reactor.core.publisher.Mono;
 
 @Slf4j
@@ -31,7 +30,7 @@ public GithubReleaseInfo() {
 
   @VisibleForTesting
   GithubReleaseInfo(String url) {
-    this.refreshMono = WebClient.create()
+    this.refreshMono = new WebClientConfigurator().build()
         .get()
         .uri(url)
         .exchangeToMono(resp -> resp.bodyToMono(GithubReleaseDto.class))
diff --git a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/WebClientConfigurator.java b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/WebClientConfigurator.java
index fe2240bd6aa..e0815828e23 100644
--- a/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/WebClientConfigurator.java
+++ b/kafka-ui-api/src/main/java/com/provectus/kafka/ui/util/WebClientConfigurator.java
@@ -5,11 +5,8 @@
 import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
 import com.provectus.kafka.ui.config.ClustersProperties;
 import com.provectus.kafka.ui.exception.ValidationException;
-import io.netty.buffer.ByteBufAllocator;
-import io.netty.handler.ssl.JdkSslContext;
 import io.netty.handler.ssl.SslContext;
 import io.netty.handler.ssl.SslContextBuilder;
-import io.netty.handler.ssl.SslProvider;
 import java.io.FileInputStream;
 import java.security.KeyStore;
 import java.util.function.Consumer;
@@ -93,7 +90,12 @@ private WebClientConfigurator configureSsl(
     // Create webclient
     SslContext context = contextBuilder.build();
 
-    builder.clientConnector(new ReactorClientHttpConnector(HttpClient.create().secure(t -> t.sslContext(context))));
+    var httpClient = HttpClient
+        .create()
+        .secure(t -> t.sslContext(context))
+        .proxyWithSystemProperties();
+
+    builder.clientConnector(new ReactorClientHttpConnector(httpClient));
     return this;
   }
 


Test patch: