clickhouse-java icon indicating copy to clipboard operation
clickhouse-java copied to clipboard

Invalid authentication:

Open ilevd opened this issue 2 years ago • 5 comments

I'm trying to connect to clickhouse with such jdbc url (clickhouse-jdbc 0.4.0):

jdbc:clickhouse://host:port/?socket_timeout=6000000&custom_settings=user%3Ddefault%2Cpassword%3Dpassword

But got an error:

Execution error (IOException) at com.clickhouse.client.http.HttpUrlConnectionImpl/checkResponse (HttpUrlConnectionImpl.java:184).
Code: 516. DB::Exception: Invalid authentication: it is not allowed to use SSL certificate authentication and authentication via parameters simultaneously simultaneously. (AUTHENTICATION_FAILED) (version 22.6.9.11 (official build))

UPD: I also tried to pass creds in ordinary url params, in params using //user:pass@, add ssl=false, sslmode=none

ilevd avatar Jan 27 '23 13:01 ilevd

Hi @ilevd, it looks like the default user is configured to use SSL certificate for authentication? Have you checked config.xml in ClickHouse server?

zhicwu avatar Jan 28 '23 02:01 zhicwu

Hi @zhicwu, settings are standard, I'm migrating from ru.yandex.clickhouse/clickhouse-jdbc "0.3.1" driver, with it it connects normally with user/password in url string.

ilevd avatar Jan 30 '23 09:01 ilevd

Might be an issue similar to #1114, will try to fix it in the upcoming connection string parser.

As a workaround, perhaps you may use connection properties to set credentials instead of putting them in url?

zhicwu avatar Jan 30 '23 10:01 zhicwu

It seems that the problem was on my side, because now it works, maybe it was some typo ot smth else. Sorry for bothering, I think we can close the issue.

ilevd avatar Jan 31 '23 08:01 ilevd

Thanks for the update. Will close this one after checking against new connection string parser.

zhicwu avatar Jan 31 '23 11:01 zhicwu

not applicable for new client-v2

chernser avatar Jan 09 '25 19:01 chernser