Skip to content

Commit c983221

Browse files
authored
Hide keystore truststore file name in logs (apache#16573)
1 parent 006b6fc commit c983221

File tree

1 file changed

+6
-0
lines changed
  • iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/utils

1 file changed

+6
-0
lines changed

iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/utils/Utils.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@
5858
import javax.net.ssl.X509TrustManager;
5959

6060
import java.io.File;
61+
import java.io.FileNotFoundException;
6162
import java.io.InputStream;
6263
import java.nio.ByteBuffer;
64+
import java.nio.file.AccessDeniedException;
6365
import java.nio.file.Files;
6466
import java.nio.file.Paths;
6567
import java.security.KeyStore;
@@ -394,6 +396,10 @@ public static Parameters initRatisConfig(RaftProperties properties, RatisConfig
394396
TrustManager trustManager =
395397
new NoHostnameVerificationTrustManager((X509TrustManager) originalTrustManager);
396398
GrpcConfigKeys.TLS.setConf(parameters, new GrpcTlsConfig(keyManager, trustManager, true));
399+
} catch (AccessDeniedException e) {
400+
LOGGER.error("Failed or truststore to load keystore file");
401+
} catch (FileNotFoundException e) {
402+
LOGGER.error("keystore or truststore file not found");
397403
} catch (Exception e) {
398404
LOGGER.error("Failed to read key store or trust store.", e);
399405
}

0 commit comments

Comments
 (0)