jonathan-albrecht-ibm commented on code in PR #12343:
URL: https://github.com/apache/kafka/pull/12343#discussion_r1031785699


##########
core/src/test/scala/kafka/security/minikdc/MiniKdc.scala:
##########
@@ -260,11 +260,17 @@ class MiniKdc(config: Properties, workDir: File) extends 
Logging {
   }
 
   private def refreshJvmKerberosConfig(): Unit = {
-    val klass =
-      if (Java.isIbmJdk)
-        Class.forName("com.ibm.security.krb5.internal.Config")
-      else
-        Class.forName("sun.security.krb5.Config")
+    // Newer IBM JDKs use the OpenJDK security providers so try that first
+    val klass = try {
+      Class.forName("sun.security.krb5.Config")
+    } catch {
+      case ex: Exception => {
+        if (Java.isIbmJdk)
+          Class.forName("com.ibm.security.krb5.internal.Config")
+        else
+          throw ex
+      }
+    }

Review Comment:
   Done



##########
core/src/test/scala/unit/kafka/utils/JaasTestUtils.scala:
##########
@@ -119,6 +120,18 @@ object JaasTestUtils {
     }
   }
 
+  private val isIbmSecurity = try {
+      Class.forName("sun.security.krb5.Config"); false
+    } catch {
+      case ex: Exception => {
+        if (Java.isIbmJdk) {
+          Class.forName("com.ibm.security.krb5.internal.Config"); true
+        } else {
+          throw ex
+        }
+      }
+    }

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to