-
Notifications
You must be signed in to change notification settings - Fork 613
Description
Describe the bug
The DummySSLConnectionSocketFactory creates a null SSLSocket because initSslContext in HttpAPIClientHelper#createHttpClient is false.
The root cause is that JdbcConfiguration does not read the ssl property from jdbc url.
Steps to reproduce
- set dependency version between 0.8.0 to 0.8.2
- set jdbc url like: jdbc:clickhouse://localhost:8123/testdb?ssl=true
Expected behaviour
SSLSocket not null
Code example
url: jdbc:clickhouse://localhost:8123/testdb?ssl=true
username: xxx
password: xxx
driver-class-name: com.clickhouse.jdbc.ClickHouseDriver
<dependency>
<groupId>com.clickhouse</groupId>
<artifactId>clickhouse-jdbc</artifactId>
<version>0.8.0</version>
</dependency>Error log
Caused by: java.lang.NullPointerException: SSL Socket
java.base/java.util.Objects.requireNonNull(Objects.java:259)
org.apache.hc.core5.util.Args.notNull(Args.java:165)
org.apache.hc.core5.http.impl.io.SocketHolder.(SocketHolder.java:58)
org.apache.hc.client5.http.impl.io.DefaultManagedHttpClientConnection.bind(DefaultManagedHttpClientConnection.java:188)
org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:232)
org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:490)
org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint(InternalExecRuntime.java:164)
org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint(InternalExecRuntime.java:174)
org.apache.hc.client5.http.impl.classic.ConnectExec.execute(ConnectExec.java:144)
org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ProtocolExec.java:192)
org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute(ContentCompressionExec.java:150)
org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute(HttpRequestRetryExec.java:113)
org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
org.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:110)
org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:174)
org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:87)
org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:55)
org.apache.hc.client5.http.classic.HttpClient.executeOpen(HttpClient.java:183)
com.clickhouse.client.api.internal.HttpAPIClientHelper.executeRequest(HttpAPIClientHelper.java:423)
Configuration
Environment
- Client version: 0.8.0 - 0.8.2
- Language version: jdk21
- OS: win11