| commit | bcd24baee4aa6d002d0e478f3357bb65d3a4dd36 | [log] [tgz] |
|---|---|---|
| author | hanicz <hanicz@users.noreply.github.com> | Sat Oct 18 11:31:56 2025 +0200 |
| committer | GitHub <noreply@github.com> | Sat Oct 18 11:31:56 2025 +0200 |
| tree | 1bd1e913566826fb094dba2e0ff4541cd1944a41 | |
| parent | 6fbf5032b13e661a414318d4f418385a9b51a075 [diff] |
KNOX-3192: Check for HttpsURLConnection before cast (#1099)
diff --git a/gateway-provider-security-authc-remote/src/main/java/org/apache/knox/gateway/filter/RemoteAuthFilter.java b/gateway-provider-security-authc-remote/src/main/java/org/apache/knox/gateway/filter/RemoteAuthFilter.java index 29536d3..799289c 100755 --- a/gateway-provider-security-authc-remote/src/main/java/org/apache/knox/gateway/filter/RemoteAuthFilter.java +++ b/gateway-provider-security-authc-remote/src/main/java/org/apache/knox/gateway/filter/RemoteAuthFilter.java
@@ -279,7 +279,7 @@ if (httpURLConnection == null) { URL url = new URL(remoteAuthUrl); connection = (HttpURLConnection) url.openConnection(); - if (trustStore != null) { + if (trustStore != null && connection instanceof HttpsURLConnection) { try { ((HttpsURLConnection) connection).setSSLSocketFactory(createSSLSocketFactory(trustStore)); } catch (Exception e) {