aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/util/cli_credentials.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/cpp/util/cli_credentials.cc')
-rw-r--r--test/cpp/util/cli_credentials.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/cpp/util/cli_credentials.cc b/test/cpp/util/cli_credentials.cc
index aa4eafb756..1f047ca3da 100644
--- a/test/cpp/util/cli_credentials.cc
+++ b/test/cpp/util/cli_credentials.cc
@@ -25,6 +25,10 @@ DEFINE_bool(use_auth, false, "Whether to create default google credentials.");
DEFINE_string(
access_token, "",
"The access token that will be sent to the server to authenticate RPCs.");
+DEFINE_string(
+ ssl_target, "",
+ "If not empty, treat the server host name as this for ssl/tls certificate "
+ "validation.");
namespace grpc {
namespace testing {
@@ -58,7 +62,13 @@ const grpc::string CliCredentials::GetCredentialUsage() const {
" --use_auth ; Set whether to create default google"
" credentials\n"
" --access_token ; Set the access token in metadata,"
- " overrides --use_auth\n";
+ " overrides --use_auth\n"
+ " --ssl_target ; Set server host for tls validation\n";
+}
+
+const grpc::string CliCredentials::GetSslTargetNameOverride() const {
+ return FLAGS_enable_ssl ? FLAGS_ssl_target : "";
}
+
} // namespace testing
} // namespace grpc