Skip to content

Commit

Permalink
Fix #25897 to avoid crashes when certificates are not yet updated (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
yashykt committed Apr 6, 2021
1 parent 04b9d19 commit c1e2ec4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/lib/security/transport/server_auth_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,13 @@ static grpc_error* server_auth_init_channel_elem(
GPR_ASSERT(!args->is_last);
grpc_auth_context* auth_context =
grpc_find_auth_context_in_args(args->channel_args);
if (auth_context == nullptr) {
grpc_error* error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"No authorization context found. This might be a TRANSIENT failure due "
"to certificates not having been loaded yet.");
gpr_log(GPR_DEBUG, "%s", grpc_error_string(error));
return error;
}
GPR_ASSERT(auth_context != nullptr);
grpc_server_credentials* creds =
grpc_find_server_credentials_in_args(args->channel_args);
Expand Down

0 comments on commit c1e2ec4

Please sign in to comment.