apache / seatunnel

SeaTunnel is a next-generation super high-performance, distributed, massive data integration tool.
https://seatunnel.apache.org/
Apache License 2.0
7.82k stars 1.76k forks source link

[Bug] [SQLserver CDC] sqlserver jdbc url encrypt=false not work #6460

Closed bjdaijun closed 6 months ago

bjdaijun commented 6 months ago

Search before asking

What happened

This is my source config: ` "source": [{ "plugin_name": "SqlServer-CDC", "username": "sa", "password": "kjct2024", "database-names":["test"], "generate_sink_sql":true, "is_exactly_once":true,

    "table-names": ["test.dbo.user"],
    "base-url": "jdbc:sqlserver://10.7.0.37:1433;databaseName=test;encrypt=false"

}],

` I want the encrypt=false wo work, but it's failed. And the seta engin log shows: it's still use encrypt=true the default value, and my jdbc url params encrypt=false is not work.

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: "encrypt" property is set to "true" and "trustServerCertificate" property is set to "false" but the driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption: Error: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target. ClientConnectionId:f1f78e44-800a-40ec-bf83-6d2aacf15d72 at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:4266) at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1965) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:3792) at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:3348) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:3179) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1953) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1263) at io.debezium.jdbc.JdbcConnection.lambda$patternBasedFactory$1(JdbcConnection.java:236) at io.debezium.jdbc.JdbcConnection$ConnectionFactoryDecorator.connect(JdbcConnection.java:121) at io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:890) at io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:885) at io.debezium.jdbc.JdbcConnection.queryAndMap(JdbcConnection.java:643) at io.debezium.jdbc.JdbcConnection.queryAndMap(JdbcConnection.java:517)

SeaTunnel Version

2.3.4

SeaTunnel Config

"source": [{
        "plugin_name": "SqlServer-CDC",
        "username": "sa",
        "password": "kjct2024",
        "database-names":["test"],
        "generate_sink_sql":true,
        "is_exactly_once":true,

        "table-names": ["test.dbo.user"],
        "base-url": "jdbc:sqlserver://10.7.0.37:1433;databaseName=test;encrypt=false"

    }],

Running Command

post by api

Error Exception

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: "encrypt" property is set to "true" and "trustServerCertificate" property is set to "false" but the driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption: Error: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target. ClientConnectionId:f1f78e44-800a-40ec-bf83-6d2aacf15d72
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:4266)
    at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1965)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:3792)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:3348)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:3179)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1953)
    at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1263)
    at io.debezium.jdbc.JdbcConnection.lambda$patternBasedFactory$1(JdbcConnection.java:236)
    at io.debezium.jdbc.JdbcConnection$ConnectionFactoryDecorator.connect(JdbcConnection.java:121)
    at io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:890)
    at io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:885)
    at io.debezium.jdbc.JdbcConnection.queryAndMap(JdbcConnection.java:643)
    at io.debezium.jdbc.JdbcConnection.queryAndMap(JdbcConnection.java:517)

Zeta or Flink or Spark Version

zeta 2.3.4

Java or Scala Version

java8

Screenshots

No response

Are you willing to submit PR?

Code of Conduct

bjdaijun commented 6 months ago

It's config error. Need use debezium to config