Get name of connector from local connector rather than from handshaker args.

PiperOrigin-RevId: 677992968
pull/37790/head
Alisha Nanda 2 months ago committed by Copybara-Service
parent 7379a9fbbe
commit febe0f1458
  1. 10
      src/core/handshaker/security/security_handshaker.cc

@ -358,16 +358,12 @@ grpc_error_handle SecurityHandshaker::OnHandshakeNextDoneLocked(
return error; return error;
} }
if (result != TSI_OK) { if (result != TSI_OK) {
auto* security_connector = args_->args.GetObject<grpc_security_connector>();
absl::string_view connector_type = "<unknown>";
if (security_connector != nullptr) {
connector_type = security_connector->type().name();
}
// TODO(roth): Get a better signal from the TSI layer as to what // TODO(roth): Get a better signal from the TSI layer as to what
// status code we should use here. // status code we should use here.
return GRPC_ERROR_CREATE(absl::StrCat( return GRPC_ERROR_CREATE(absl::StrCat(
connector_type, " handshake failed (", tsi_result_to_string(result), connector_->type().name(), " handshake failed (",
")", (tsi_handshake_error_.empty() ? "" : ": "), tsi_handshake_error_)); tsi_result_to_string(result), ")",
(tsi_handshake_error_.empty() ? "" : ": "), tsi_handshake_error_));
} }
// Update handshaker result. // Update handshaker result.
if (handshaker_result != nullptr) { if (handshaker_result != nullptr) {

Loading…
Cancel
Save