Skip to content
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

Implemented connecting to ClickHouse server over TLS #109

Merged
merged 4 commits into from
Nov 11, 2021

Conversation

Enmk
Copy link
Collaborator

@Enmk Enmk commented Oct 25, 2021

Using OpenSSL

  • set -DWITH_OPENSSL:BOOL=ON to enable
  • can use non-system OpenSSL with -DOPENSSL_ROOT_DIR=<path-to-OpenSSL>

Client behavior is customizable with ClientOptions::SSLOptions

  • min/max protocol versions
  • SNI extension ON\OFF
  • CA files or directory
  • other tweaks available via SSL_CTX_set_options
  • OR provide pre-configured SSL_CTX with any customizations.

Tests to verify TLS connection to an external host.
Tests to verify TLS connection to locally started CH with custom CA (CA and certificate files not included)

- using OpenSSL
  - set `-DWITH_OPENSSL:BOOL=ON` to enable
  - can use non-system OpenSSL with `-DOPENSSL_ROOT_DIR=<path-to-OpenSSL>`
- Client behavior is customizable with `ClientOptions::SSLOptions`
  - min/max protocol versions
  - SNI extension ON\OFF
  - CA files or directory
  - other tweaks available via `SSL_CTX_set_options`
  - OR provide pre-configured `SSL_CTX` with any customizations.

Tests to verify TLS connection to an external host.
Tests to verify TLS connection to locally started CH.
Copy link
Collaborator

@traceon traceon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comments.

.github/workflows/linux_ssl.yml Outdated Show resolved Hide resolved
clickhouse/CMakeLists.txt Outdated Show resolved Hide resolved
cmake/openssl.cmake Outdated Show resolved Hide resolved
clickhouse/client.h Outdated Show resolved Hide resolved
clickhouse/client.h Outdated Show resolved Hide resolved
clickhouse/base/sslsocket.cpp Outdated Show resolved Hide resolved
clickhouse/client.cpp Show resolved Hide resolved
clickhouse/base/sslsocket.cpp Outdated Show resolved Hide resolved
clickhouse/base/sslsocket.cpp Outdated Show resolved Hide resolved
clickhouse/base/sslsocket.cpp Outdated Show resolved Hide resolved
@traceon traceon self-assigned this Nov 3, 2021
@Enmk Enmk force-pushed the openssl branch 2 times, most recently from 3a68389 to e06893b Compare November 8, 2021 19:53
Copy link
Collaborator

@traceon traceon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left inline comments.

ut/client_ut.cpp Outdated Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
ut/ssl_ut.cpp Show resolved Hide resolved
ut/readonly_client_ut.h Outdated Show resolved Hide resolved
ut/connection_failed_client_ut.h Outdated Show resolved Hide resolved
clickhouse/client.h Outdated Show resolved Hide resolved
ut/readonly_client_ut.cpp Outdated Show resolved Hide resolved
ut/ssl_ut.cpp Show resolved Hide resolved
ut/ssl_ut.cpp Outdated Show resolved Hide resolved
clickhouse/base/sslsocket.h Outdated Show resolved Hide resolved
minor renaming, comments and other grooming
@traceon traceon merged commit 5cfda7f into ClickHouse:master Nov 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants