From b5703222a5f856bd7b678636964be36fab1f9e17 Mon Sep 17 00:00:00 2001
From: murgatroid99 <mlumish@google.com>
Date: Fri, 18 Dec 2015 13:05:34 -0800
Subject: [PATCH] Include roots.pem with Ruby package

---
 grpc.gemspec         | 1 +
 src/ruby/lib/grpc.rb | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/grpc.gemspec b/grpc.gemspec
index 5526dbeb4f..f99b11e873 100755
--- a/grpc.gemspec
+++ b/grpc.gemspec
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
   s.requirements << 'libgrpc ~> 0.11.0 needs to be installed'
 
   s.files = %w( Rakefile Makefile )
+  s.files += %w( etc/roots.pem )
   s.files += Dir.glob('src/ruby/bin/**/*')
   s.files += Dir.glob('src/ruby/ext/**/*')
   s.files += Dir.glob('src/ruby/lib/**/*')
diff --git a/src/ruby/lib/grpc.rb b/src/ruby/lib/grpc.rb
index 80b5743e91..228fbe366c 100644
--- a/src/ruby/lib/grpc.rb
+++ b/src/ruby/lib/grpc.rb
@@ -27,6 +27,11 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+ssl_roots_path = File.expand_path('../../../etc/roots.pem', __FILE__)
+unless ENV['GRPC_DEFAULT_SSL_ROOTS_FILE_PATH']
+  ENV['GRPC_DEFAULT_SSL_ROOTS_FILE_PATH'] = ssl_roots_path
+end
+
 require 'grpc/errors'
 require 'grpc/grpc'
 require 'grpc/logconfig'
-- 
GitLab