Clickhouse JDBC version > 0.4.x fails in Cloud

69 views Asked by At

I have to connect a java cloud application to clickhouse cloud database. The restriction is that the certificate cannot be uploaded to the cloud application.

clickhouse-jdbc version 0.3.2 works perfectly with this jdbc url:

jdbc:clickhouse://xxxxxx.aws.clickhouse.cloud:8443/dev?ssl=true&sslkey=xxxxxx&sslcert=xxxxxxxxx

The connection fails using any clickhouse-jdbc version above 0.4.x:

Caused by: java.sql.SQLException: Could not open file from: classpath:xxxxxx, server ClickHouseNode [uri=https://xxx.aws.clickhouse.cloud:8443/dev, options={sslmode=strict,key_store_type=*,sslkey=*,sslcert=xxxxxx}]@1390580080
    at com.clickhouse.jdbc.SqlExceptionUtils.handle(SqlExceptionUtils.java:85)
    at com.clickhouse.jdbc.SqlExceptionUtils.create(SqlExceptionUtils.java:31)
    at com.clickhouse.jdbc.SqlExceptionUtils.handle(SqlExceptionUtils.java:90)
    at com.clickhouse.jdbc.internal.ClickHouseConnectionImpl.getServerInfo(ClickHouseConnectionImpl.java:131)
    at com.clickhouse.jdbc.internal.ClickHouseConnectionImpl.<init>(ClickHouseConnectionImpl.java:335)
    at com.clickhouse.jdbc.internal.ClickHouseConnectionImpl.<init>(ClickHouseConnectionImpl.java:288)
    at com.clickhouse.jdbc.ClickHouseDriver.connect(ClickHouseDriver.java:157)
    at com.clickhouse.jdbc.ClickHouseDriver.connect(ClickHouseDriver.java:41)
    at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:681)
    at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:190)
    at com.onibex.connect.delta.jdbc.dialect.CommonDatabaseDialect.getConnection(CommonDatabaseDialect.java:154)
    at com.onibex.connect.delta.jdbc.connection.ConnectionFactory.newConnection(ConnectionFactory.java:83)
    at com.onibex.connect.delta.jdbc.connection.ConnectionFactory.getConnection(ConnectionFactory.java:55)
    ... 14 more
Caused by: java.io.FileNotFoundException: Could not open file from: classpath:xxxxxx
    at com.clickhouse.data.ClickHouseUtils.getFileInputStream(ClickHouseUtils.java:981)
    at com.clickhouse.client.config.ClickHouseDefaultSslContextProvider.getKeyStore(ClickHouseDefaultSslContextProvider.java:104)

I have tried different combinations with these paramaters:

ssl=true/false

sslmode=strict/none

http_connection_provider=HTTP_CLIENT

But it is not working. Any idea what's the url for clickHouse-jdbc (com.clickhouse.clickhouse-jdbc) version > 0.4x to connect to clickhouse cloud without a certificate?

0

There are 0 answers