This is an automated email from the ASF dual-hosted git repository.

hanicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git


The following commit(s) were added to refs/heads/master by this push:
     new bcd24baee KNOX-3192: Check for HttpsURLConnection before cast (#1099)
bcd24baee is described below

commit bcd24baee4aa6d002d0e478f3357bb65d3a4dd36
Author: hanicz <[email protected]>
AuthorDate: Sat Oct 18 11:31:56 2025 +0200

    KNOX-3192: Check for HttpsURLConnection before cast (#1099)
---
 .../src/main/java/org/apache/knox/gateway/filter/RemoteAuthFilter.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 29536d35c..799289c7f 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 @@ public class RemoteAuthFilter implements Filter {
     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) {

Reply via email to