From 6d6009fec52947376d5d584f7f60a72dde723159 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 15 Oct 2015 09:57:31 -0700 Subject: [PATCH] Distribute roots.pem with the Node package --- package.json | 1 + src/node/index.js | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/package.json b/package.json index c624c45107e..54efb69b042 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "src/core", "test/proto", "include", + "etc", "binding.gyp" ], "main": "src/node/index.js", diff --git a/src/node/index.js b/src/node/index.js index 591d9dd9155..0d1a7fd887b 100644 --- a/src/node/index.js +++ b/src/node/index.js @@ -33,6 +33,14 @@ 'use strict'; +var path = require('path'); + +var SSL_ROOTS_PATH = path.resolve(__dirname, '..', '..', 'etc', 'roots.pem'); + +if (!process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH) { + process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH = SSL_ROOTS_PATH; +} + var _ = require('lodash'); var ProtoBuf = require('protobufjs');