ruanhang1993 commented on code in PR #4156:
URL: https://github.com/apache/flink-cdc/pull/4156#discussion_r2944009707


##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql/debezium/DebeziumUtils.java:
##########
@@ -93,13 +111,27 @@ public static MySqlConnection createMySqlConnection(
     }
 
     /** Creates a new {@link BinaryLogClient} for consuming mysql binlog. */
-    public static BinaryLogClient createBinaryClient(Configuration 
dbzConfiguration) {
+    public static BinaryLogClient createBinaryClient(
+            Configuration dbzConfiguration, MySqlConnection connection) {
         final MySqlConnectorConfig connectorConfig = new 
MySqlConnectorConfig(dbzConfiguration);
-        return new BinaryLogClient(
-                connectorConfig.hostname(),
-                connectorConfig.port(),
-                connectorConfig.username(),
-                connectorConfig.password());
+        BinaryLogClient client =
+                new BinaryLogClient(
+                        connectorConfig.hostname(),
+                        connectorConfig.port(),
+                        connectorConfig.username(),
+                        connectorConfig.password());
+        SSLMode sslMode = sslModeFor(connectorConfig.sslMode());
+        if (sslMode != null) {

Review Comment:
   Hi, @watsonjo737 .
   
   I previously left a review comment about the null pointer issue here. 
However, I now noticed through the comments that the same code exists in 
`MySqlStreamingChangeEventSource` — when it creates the client, it does not 
perform an additional null check. It expects an error to be thrown for invalid 
values, and `sslMode` has a default value. Should we revert this to the same 
logic as `MySqlStreamingChangeEventSource`, so that it also throws an error 
when encountering null? WDYT.
   
   CC @lvyanquan 



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