From 7123a41cb1df3e3abf1dca17851166de30639d77 Mon Sep 17 00:00:00 2001 From: Stanley Cheung Date: Mon, 13 Jan 2020 22:25:38 -0800 Subject: [PATCH] PHP: Fix logic setting roots pem --- src/php/lib/Grpc/BaseStub.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/php/lib/Grpc/BaseStub.php b/src/php/lib/Grpc/BaseStub.php index e92990f1a8b..7669ba74338 100644 --- a/src/php/lib/Grpc/BaseStub.php +++ b/src/php/lib/Grpc/BaseStub.php @@ -43,7 +43,8 @@ class BaseStub */ public function __construct($hostname, $opts, $channel = null) { - if (!ChannelCredentials::isDefaultRootsPemSet()) { + if (!method_exists('ChannelCredentials', 'isDefaultRootsPemSet') || + !ChannelCredentials::isDefaultRootsPemSet()) { $ssl_roots = file_get_contents( dirname(__FILE__).'/../../../../etc/roots.pem' );