diff --git a/src/ruby/lib/grpc/generic/client_stub.rb b/src/ruby/lib/grpc/generic/client_stub.rb index fc9c7a2b5262f8a8b633c38045338b3fa3a262b3..01328d4a5bc68895716942b1f360ed0c9b911d7e 100644 --- a/src/ruby/lib/grpc/generic/client_stub.rb +++ b/src/ruby/lib/grpc/generic/client_stub.rb @@ -101,7 +101,8 @@ module GRPC @queue = q @ch = ClientStub.setup_channel(channel_override, host, creds, **kw) @update_metadata = ClientStub.check_update_metadata(update_metadata) - @host = host + alt_host = kw[Core::Channel::SSL_TARGET] + @host = alt_host.nil? ? host : alt_host @deadline = deadline end @@ -395,12 +396,7 @@ module GRPC # @param deadline [TimeConst] def new_active_call(ch, marshal, unmarshal, deadline = nil) absolute_deadline = Core::TimeConsts.from_relative_time(deadline) - # It should be OK to to pass the hostname:port to create_call, but at - # the moment this fails a security check. This will be corrected. - # - # TODO: # remove this after create_call is updated - host = @host.split(':')[0] - call = @ch.create_call(ch, host, absolute_deadline) + call = @ch.create_call(ch, @host, absolute_deadline) ActiveCall.new(call, @queue, marshal, unmarshal, absolute_deadline, started: false) end