aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/php/lib/Grpc
diff options
context:
space:
mode:
authorGravatar thinkerou <thinkerou@gmail.com>2016-06-09 11:57:15 +0800
committerGravatar thinkerou <thinkerou@gmail.com>2016-06-17 09:41:04 +0800
commitf3bc3b62a776c34b916c7771177629b4620dbfec (patch)
tree5361402c84a202dafb831d65ccd8aef1eeea4789 /src/php/lib/Grpc
parentfa9b7c1bc6488be17d18007f45c57dac39ea5b79 (diff)
Load default roots.pem in PHP via grpc_set_ssl_roots_override_callback
Diffstat (limited to 'src/php/lib/Grpc')
-rwxr-xr-xsrc/php/lib/Grpc/BaseStub.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/php/lib/Grpc/BaseStub.php b/src/php/lib/Grpc/BaseStub.php
index 70644fac87..df3fe85d44 100755
--- a/src/php/lib/Grpc/BaseStub.php
+++ b/src/php/lib/Grpc/BaseStub.php
@@ -56,6 +56,10 @@ class BaseStub
*/
public function __construct($hostname, $opts, $channel = null)
{
+ $ssl_roots = file_get_contents(
+ dirname(__FILE__).'/../../../../etc/roots.pem');
+ ChannelCredentials::setDefaultRootsPem($ssl_roots);
+
$this->hostname = $hostname;
$this->update_metadata = null;
if (isset($opts['update_metadata'])) {