From 4c7caf61803ea2acd9b06730fa8e1d22912a2520 Mon Sep 17 00:00:00 2001
From: Tim Emiola <temiola@google.com>
Date: Fri, 6 Mar 2015 11:35:58 -0800
Subject: [PATCH] Fix for #804

---
 src/ruby/lib/grpc/generic/client_stub.rb | 10 +++-------
 1 file 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
-- 
GitLab