Skip to content

Commit ac1c1d6

Browse files
committed
refactor(remoting): 优化 TlsHelper 类的代码格式- 调整了代码缩进和格式,提高了代码的可读性
- 修复了一些潜在的代码风格问题 Signed-off-by: Async <raisinata@foxmail.com>
1 parent 1738e0b commit ac1c1d6

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

  • remoting/src/main/java/org/apache/rocketmq/remoting/netty

remoting/src/main/java/org/apache/rocketmq/remoting/netty/TlsHelper.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public interface DecryptionStrategy {
6666
* Decrypt the target encrpted private key file.
6767
*
6868
* @param privateKeyEncryptPath A pathname string
69-
* @param forClient tells whether it's a client-side key file
69+
* @param forClient tells whether it's a client-side key file
7070
* @return An input stream for a decrypted key file
7171
* @throws IOException if an I/O error has occurred
7272
*/
@@ -125,9 +125,9 @@ public static SslContext buildSslContext(boolean forClient, InputStream certInpu
125125
}
126126

127127
return sslContextBuilder.keyManager(
128-
!isNullOrEmpty(tlsClientCertPath) ? new FileInputStream(tlsClientCertPath) : null,
129-
!isNullOrEmpty(tlsClientKeyPath) ? decryptionStrategy.decryptPrivateKey(tlsClientKeyPath, true) : null,
130-
!isNullOrEmpty(tlsClientKeyPassword) ? tlsClientKeyPassword : null)
128+
!isNullOrEmpty(tlsClientCertPath) ? new FileInputStream(tlsClientCertPath) : null,
129+
!isNullOrEmpty(tlsClientKeyPath) ? decryptionStrategy.decryptPrivateKey(tlsClientKeyPath, true) : null,
130+
!isNullOrEmpty(tlsClientKeyPassword) ? tlsClientKeyPassword : null)
131131
.build();
132132
}
133133
} else {
@@ -151,9 +151,9 @@ public static SslContext buildSslContext(boolean forClient, InputStream certInpu
151151
.sslProvider(provider);
152152
} else {
153153
sslContextBuilder = SslContextBuilder.forServer(
154-
!isNullOrEmpty(tlsServerCertPath) ? new FileInputStream(tlsServerCertPath) : null,
155-
!isNullOrEmpty(tlsServerKeyPath) ? decryptionStrategy.decryptPrivateKey(tlsServerKeyPath, false) : null,
156-
!isNullOrEmpty(tlsServerKeyPassword) ? tlsServerKeyPassword : null)
154+
!isNullOrEmpty(tlsServerCertPath) ? new FileInputStream(tlsServerCertPath) : null,
155+
!isNullOrEmpty(tlsServerKeyPath) ? decryptionStrategy.decryptPrivateKey(tlsServerKeyPath, false) : null,
156+
!isNullOrEmpty(tlsServerKeyPassword) ? tlsServerKeyPassword : null)
157157
.sslProvider(provider);
158158
}
159159

0 commit comments

Comments
 (0)