-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ClientOptions().SetHost("hostname") throws an exception #374
Comments
This appears to be related to SSL verification within my organization. How do I disable that? |
Hi @DKGH! It looks like you are either trying to connect to SSL port with as a non-ssl client, or vice versa. to configure a non-ssl connectionauto client_options = ClientOptions()
.SetHost(server_hostname)
.SetPort(server_port) // typically 9000
.SetUser(user_name) // optional
.SetPassword(password) // optional
.SetDefaultDatabase(database_name); // optional
to configure an ssl connection:// almost the same as above, but make sure that you are using correct PORT
auto client_options = ClientOptions()
.SetHost(server_hostname)
.SetPort(server_port) // typically 9440 <<<=================!!!!! HERE
.SetUser(user_name) // optional
.SetPassword(password) // optional
.SetDefaultDatabase(database_name); // optional
client_options.SetSSLOptions(
ClientOptions::SSLOptions()
.SetUseDefaultCALocations(true)
.SetMaxProtocolVersion(SSL3_VERSION)); And then (regardless of how you've initialized auto client_ = std::make_unique<Client>(client_options); |
For configuring SSL connection there is a TON of options: But if you have a example that produces proper clickhouse-cpp/clickhouse/client.h Line 152 in 2a49a25
Please note that this is a CLIENT context, not a SERVER context |
I ran the sample program listed on the README.md tutorial. However, it throws a system_error exception at line 409 in client.cpp. This is mitigated by entering the right port. Now the exception comes after a long wait and it says operation successful:
can't recieve string data: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
I would like to connect to a database and run some select queries on it. How do I do that? I have database host machine name and port, user name, password and table name.
The text was updated successfully, but these errors were encountered: