Skip to content

Commit ceea93f

Browse files
committed
conditional testbench creds
1 parent ff2896e commit ceea93f

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

google/cloud/storage/internal/grpc/default_options.cc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,15 @@ Options DefaultOptionsGrpc(
8989
// !conformance.has_value()) {
9090
if (testbench.has_value() && !testbench->empty()) {
9191
options.set<EndpointOption>(*testbench);
92-
// The emulator does not support HTTPS or authentication, use insecure
93-
// (sometimes called "anonymous") credentials, which disable SSL.
94-
options.set<UnifiedCredentialsOption>(MakeInsecureCredentials());
95-
std::cout << __func__ << ": testbench detected forcing InsecureCredentials"
96-
<< std::endl;
92+
93+
if (!conformance.has_value()) {
94+
// The emulator does not support HTTPS or authentication, use insecure
95+
// (sometimes called "anonymous") credentials, which disable SSL.
96+
options.set<UnifiedCredentialsOption>(MakeInsecureCredentials());
97+
std::cout << __func__
98+
<< ": testbench detected forcing InsecureCredentials"
99+
<< std::endl;
100+
}
97101
}
98102

99103
// gRPC <= 1.64 may crash when metrics are enabled, so we don't enable them by

0 commit comments

Comments
 (0)