anmolnar commented on code in PR #4747:
URL: https://github.com/apache/hbase/pull/4747#discussion_r958892912


##########
hbase-common/src/main/java/org/apache/hadoop/hbase/io/crypto/tls/X509Util.java:
##########
@@ -225,27 +226,26 @@ public static SslContext 
createSslContextForServer(Configuration config)
    * @return the key manager.
    * @throws KeyManagerException if something goes wrong.
    */
-  static X509KeyManager createKeyManager(String keyStoreLocation, String 
keyStorePassword,
+  static X509KeyManager createKeyManager(String keyStoreLocation, char[] 
keyStorePassword,
     String keyStoreType) throws KeyManagerException {
 
-    if (keyStorePassword == null) {
-      keyStorePassword = "";
-    }
-
     if (keyStoreType == null) {
       keyStoreType = "jks";
     }
 
+    if (keyStorePassword == null) {
+      keyStorePassword = EMPTY_CHAR_ARRAY;
+    }
+
     try {
-      char[] password = keyStorePassword.toCharArray();
       KeyStore ks = KeyStore.getInstance(keyStoreType);
       try (InputStream inputStream =
         new BufferedInputStream(Files.newInputStream(new 
File(keyStoreLocation).toPath()))) {

Review Comment:
   Why should we use unbuffered stream here?



-- 
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