ruanwenjun commented on code in PR #15802:
URL: 
https://github.com/apache/dolphinscheduler/pull/15802#discussion_r1554626084


##########
dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/NettyRemotingClient.java:
##########
@@ -79,8 +84,17 @@ public class NettyRemotingClient implements AutoCloseable {
 
     private final ScheduledExecutorService responseFutureExecutor;
 
+    private SslContext sslContext = null;
+
     public NettyRemotingClient(final NettyClientConfig clientConfig) {
         this.clientConfig = clientConfig;
+        if(NettyUtils.isNettySSLEnable()){
+            try {
+                sslContext = SslContextBuilder.forClient().trustManager(new 
File(NettyUtils.getNettyCertPath())).build();
+            } catch (SSLException e) {
+                throw new RuntimeException(e);

Review Comment:
   ```suggestion
                   throw new IllegalArgumentException("Initialize SslContext 
error, please check the cert-file", e);
   ```



##########
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/constants/Constants.java:
##########
@@ -735,4 +735,14 @@ private Constants() {
      * K8S sensitive param
      */
     public static final String K8S_CONFIG_REGEX = "(?<=((?i)configYaml(\" : 
\"))).*?(?=(\",\\n))";
+
+
+    /**
+     * netty config enable
+     */
+    public static final String NETTY_SSL_ENABLE = "netty.ssl.enable";
+
+    public static final String NETTY_SSL_KEY_PATH = "netty.ssl.key.path";
+
+    public static final String NETTY_SSL_CERT_PATH = "netty.ssl.cert.path";

Review Comment:
   Pleas move this kind of config into `application.yaml`, we shouldn't  add 
new config into common.properties.
   ```
   rpc:
      ssl:
          enable: true
          cert-file: 
          key-file: 
   ```
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to