diff options
-rw-r--r-- | src/ruby/lib/grpc/generic/client_stub.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/ruby/lib/grpc/generic/client_stub.rb b/src/ruby/lib/grpc/generic/client_stub.rb index fc9c7a2b52..01328d4a5b 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 |