Skip to content

Commit

Permalink
using the fixed localhost as the endpoint, so that the client verify …
Browse files Browse the repository at this point in the history
…the host could success during the TLS handshake
  • Loading branch information
Hang Zheng committed Oct 16, 2024
1 parent 62d0294 commit 94623a2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/src/arrow/filesystem/s3_test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const char* kEnvConnectString = "ARROW_TEST_S3_CONNECT_STRING";
const char* kEnvAccessKey = "ARROW_TEST_S3_ACCESS_KEY";
const char* kEnvSecretKey = "ARROW_TEST_S3_SECRET_KEY";

std::string GenerateConnectString() { return GetListenAddress(); }
std::string GenerateConnectString() { return GetListenAddress("localhost"); }

} // namespace

Expand Down
6 changes: 6 additions & 0 deletions cpp/src/arrow/testing/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ std::string GetListenAddress() {
return ss.str();
}

std::string GetListenAddress(const std::string& host) {
std::stringstream ss;
ss << host << ":" << GetListenPort();
return ss.str();
}

const std::vector<std::shared_ptr<DataType>>& all_dictionary_index_types() {
static std::vector<std::shared_ptr<DataType>> types = {
int8(), uint8(), int16(), uint16(), int32(), uint32(), int64(), uint64()};
Expand Down
4 changes: 4 additions & 0 deletions cpp/src/arrow/testing/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ ARROW_TESTING_EXPORT int GetListenPort();
// port conflicts.
ARROW_TESTING_EXPORT std::string GetListenAddress();

// Get a "host:port" to listen on. Compared to GetListenAddress(), this function would use
// the host passed in.
ARROW_TESTING_EXPORT std::string GetListenAddress(const std::string& host);

ARROW_TESTING_EXPORT
const std::vector<std::shared_ptr<DataType>>& all_dictionary_index_types();

Expand Down

0 comments on commit 94623a2

Please sign in to comment.