Skip to content

Commit

Permalink
Fixed TLS-enabled build + cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Enmk committed Nov 1, 2021
1 parent 964a070 commit 009b8af
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 75 deletions.
2 changes: 0 additions & 2 deletions clickhouse/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
SET ( clickhouse-cpp-lib-src
base/coded.cpp
base/compressed.cpp
base/input.cpp
base/output.cpp
Expand Down Expand Up @@ -73,7 +72,6 @@ INSTALL(FILES query.h DESTINATION include/clickhouse/)

# base
INSTALL(FILES base/buffer.h DESTINATION include/clickhouse/base/)
INSTALL(FILES base/coded.h DESTINATION include/clickhouse/base/)
INSTALL(FILES base/compressed.h DESTINATION include/clickhouse/base/)
INSTALL(FILES base/input.h DESTINATION include/clickhouse/base/)
INSTALL(FILES base/output.h DESTINATION include/clickhouse/base/)
Expand Down
30 changes: 0 additions & 30 deletions clickhouse/base/coded.cpp

This file was deleted.

10 changes: 0 additions & 10 deletions clickhouse/base/coded.h

This file was deleted.

4 changes: 4 additions & 0 deletions clickhouse/base/sslsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ SSLSocketInput::SSLSocketInput(SSL *ssl)

SSLSocketInput::~SSLSocketInput() = default;

bool SSLSocketInput::Skip(size_t /*bytes*/) {
return false;
}

size_t SSLSocketInput::DoRead(void* buf, size_t len) {
size_t actually_read;
HANDLE_SSL_ERROR(SSL_read_ex(ssl_, buf, len, &actually_read));
Expand Down
2 changes: 2 additions & 0 deletions clickhouse/base/sslsocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class SSLSocketInput : public InputStream {
explicit SSLSocketInput(SSL *ssl);
~SSLSocketInput();

bool Skip(size_t bytes) override;

protected:
size_t DoRead(void* buf, size_t len) override;

Expand Down
1 change: 0 additions & 1 deletion clickhouse/client.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "client.h"
#include "protocol.h"

#include "base/coded.h"
#include "base/compressed.h"
#include "base/socket.h"
#include "base/streamstack.h"
Expand Down
64 changes: 32 additions & 32 deletions ut/client_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1053,37 +1053,37 @@ INSTANTIATE_TEST_CASE_P(
}
));

// Special test that require properly configured TLS-enabled version of CH running locally
INSTANTIATE_TEST_CASE_P(
LocalhostTLS_None, ReadonlyClientTest,
::testing::Values(std::tuple<ClientOptions, std::vector<std::string> > {
ClientOptions()
.SetHost("127.0.0.1")
.SetPort(9440)
.SetUser("default")
.SetPingBeforeQuery(true)
.SetCompressionMethod(CompressionMethod::None)
.SetSSLOptions(ClientOptions::SSLOptions()
.PathToCADirectory("./CA/")
.UseSNI(false)),
QUERIES
}
));

INSTANTIATE_TEST_CASE_P(
LocalhostTLS_LZ4, ReadonlyClientTest,
::testing::Values(std::tuple<ClientOptions, std::vector<std::string> > {
ClientOptions()
.SetHost("127.0.0.1")
.SetPort(9440)
.SetUser("default")
.SetPingBeforeQuery(true)
.SetCompressionMethod(CompressionMethod::LZ4)
.SetSSLOptions(ClientOptions::SSLOptions()
.PathToCADirectory("./CA/")
.UseSNI(false)),
QUERIES
}
));
//// Special test that require properly configured TLS-enabled version of CH running locally
//INSTANTIATE_TEST_CASE_P(
// LocalhostTLS_None, ReadonlyClientTest,
// ::testing::Values(std::tuple<ClientOptions, std::vector<std::string> > {
// ClientOptions()
// .SetHost("127.0.0.1")
// .SetPort(9440)
// .SetUser("default")
// .SetPingBeforeQuery(true)
// .SetCompressionMethod(CompressionMethod::None)
// .SetSSLOptions(ClientOptions::SSLOptions()
// .PathToCADirectory("./CA/")
// .UseSNI(false)),
// QUERIES
// }
//));

//INSTANTIATE_TEST_CASE_P(
// LocalhostTLS_LZ4, ReadonlyClientTest,
// ::testing::Values(std::tuple<ClientOptions, std::vector<std::string> > {
// ClientOptions()
// .SetHost("127.0.0.1")
// .SetPort(9440)
// .SetUser("default")
// .SetPingBeforeQuery(true)
// .SetCompressionMethod(CompressionMethod::LZ4)
// .SetSSLOptions(ClientOptions::SSLOptions()
// .PathToCADirectory("./CA/")
// .UseSNI(false)),
// QUERIES
// }
//));

#endif

0 comments on commit 009b8af

Please sign in to comment.