charlesconnell commented on code in PR #5444:
URL: https://github.com/apache/hbase/pull/5444#discussion_r1346383716


##########
hbase-common/src/main/java/org/apache/hadoop/hbase/io/crypto/tls/X509Util.java:
##########
@@ -219,17 +219,17 @@ static String[] getDefaultCipherSuites(boolean 
useOpenSsl) {
 
   static String[] getDefaultCipherSuitesForJavaVersion(String javaVersion) {
     Objects.requireNonNull(javaVersion);
-    if (javaVersion.matches("\\d+")) {
-      // Must be Java 9 or later
-      LOG.debug("Using Java9+ optimized cipher suites for Java version {}", 
javaVersion);
-      return DEFAULT_CIPHERS_JAVA9;
-    } else if (javaVersion.startsWith("1.")) {
-      // Must be Java 1.8 or earlier
-      LOG.debug("Using Java8 optimized cipher suites for Java version {}", 
javaVersion);
-      return DEFAULT_CIPHERS_JAVA8;
-    } else {
-      LOG.debug("Could not parse java version {}, using Java8 optimized cipher 
suites",
-        javaVersion);
+
+    try {
+      int javaVersionInt = Integer.parseInt(javaVersion);
+      if (javaVersionInt >= 11) {
+        return DEFAULT_CIPHERS_JAVA11;
+      } else if (javaVersionInt >= 9) {
+        return DEFAULT_CIPHERS_JAVA9;
+      } else {
+        return DEFAULT_CIPHERS_JAVA8;
+      }
+    } catch (NumberFormatException ignore) {

Review Comment:
   I haven't forgotten about this comment, just had some other stuff take 
priority.



-- 
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: issues-unsubscr...@hbase.apache.org

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

Reply via email to