Disable check_call_host when server_verification_option is not GRPC_TLS_SERVER_VERIFICATION (#25577)

Disable check_call_host when server_verification_option is not GRPC_TLS_SERVER_VERIFICATION
reviewable/pr25361/r4
Yash Tibrewal 4 years ago committed by GitHub
parent 2a656ce68b
commit d861ececfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/core/lib/security/security_connector/tls/tls_security_connector.cc

@ -318,6 +318,12 @@ int TlsChannelSecurityConnector::cmp(
bool TlsChannelSecurityConnector::check_call_host(
absl::string_view host, grpc_auth_context* auth_context,
grpc_closure* /*on_call_host_checked*/, grpc_error** error) {
if (options_->server_verification_option() ==
GRPC_TLS_SKIP_HOSTNAME_VERIFICATION ||
options_->server_verification_option() ==
GRPC_TLS_SKIP_ALL_SERVER_VERIFICATION) {
return true;
}
return grpc_ssl_check_call_host(host, target_name_.c_str(),
overridden_target_name_.c_str(), auth_context,
error);

Loading…
Cancel
Save