Skip to content

Commit

Permalink
Fix error message for hostname verification failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewstevenson88 committed Jan 3, 2024
1 parent 1f9cea6 commit 515cccd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/cpp/end2end/ssl_credentials_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ TEST_P(SslCredentialsTest, ServerHostnameVerificationFails) {
});
notification.WaitForNotification();

std::string root_cert = ReadFile(kClientCertPath);
std::string root_cert = ReadFile(kCaCertPath);
std::string client_key = ReadFile(kClientKeyPath);
std::string client_cert = ReadFile(kClientCertPath);
grpc::SslCredentialsOptions ssl_options;
Expand All @@ -618,8 +618,9 @@ TEST_P(SslCredentialsTest, ServerHostnameVerificationFails) {
auto auth_context =
DoRpc(ssl_options, cache, /*override_ssl_target_name=*/false);
EXPECT_EQ(auth_context.status().code(), absl::StatusCode::kUnavailable);
EXPECT_THAT(auth_context.status().message(),
HasSubstr("CERTIFICATE_VERIFY_FAILED"));
// TODO(matthewstevenson88): Logs say "No match found for server name:
// localhost." but this error is not propagated to the user. Fix this.
EXPECT_FALSE(auth_context.status().message().empty());
EXPECT_EQ(GetSessionCacheSize(cache), 0);

grpc_ssl_session_cache_destroy(cache);
Expand Down

0 comments on commit 515cccd

Please sign in to comment.