From 523fa18efd40687edcc1d6f6e82a448885830133 Mon Sep 17 00:00:00 2001 From: Wesley Silva Date: Mon, 23 Jun 2025 14:07:04 -0300 Subject: [PATCH 1/2] Update to v1.73.0 --- composer.json | 11 ++++------- etc/README.md | 4 ++++ src/lib/BaseStub.php | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 etc/README.md diff --git a/composer.json b/composer.json index 755ea4b..9758994 100644 --- a/composer.json +++ b/composer.json @@ -1,21 +1,18 @@ { - "name": "grpc/grpc", + "name": "grpc/grpc", "type": "library", "description": "gRPC library for PHP", "keywords": ["rpc"], "homepage": "https://grpc.io", "license": "Apache-2.0", - "version": "1.57.0", + "version": "1.73.0", "require": { - "php": ">=7.0.0" + "php": ">=7.0.0", + "google/protobuf": "^v3.3.0" }, "require-dev": { "google/auth": "^v1.3.0" }, - "suggest": { - "ext-protobuf": "For better performance, install the protobuf C extension.", - "google/protobuf": "To get started using grpc quickly, install the native protobuf library." - }, "autoload": { "psr-4": { "Grpc\\": "src/lib/" diff --git a/etc/README.md b/etc/README.md new file mode 100644 index 0000000..87af44f --- /dev/null +++ b/etc/README.md @@ -0,0 +1,4 @@ +The roots.pem file is periodically generated from: +https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt +using +https://github.com/agl/extract-nss-root-certs diff --git a/src/lib/BaseStub.php b/src/lib/BaseStub.php index d9da4ca..5f7d2a9 100644 --- a/src/lib/BaseStub.php +++ b/src/lib/BaseStub.php @@ -46,7 +46,7 @@ public function __construct($hostname, $opts, $channel = null) if (!method_exists('Grpc\ChannelCredentials', 'isDefaultRootsPemSet') || !ChannelCredentials::isDefaultRootsPemSet()) { $ssl_roots = file_get_contents( - dirname(__FILE__).'/../../etc/roots.pem' + dirname(__FILE__).'/../../../../etc/roots.pem' ); ChannelCredentials::setDefaultRootsPem($ssl_roots); } @@ -228,7 +228,7 @@ private function _get_jwt_aud_uri($method) } // Remove the port if it is 443 - // See https://github.com/grpc/grpc/blob/07c9f7a36b2a0d34fcffebc85649cf3b8c339b5d/src/core/lib/security/transport/client_auth_filter.cc#L205 + // See https://github.com/grpc/grpc/blob/07c9f7a36b2a0d34fcffebc85649cf3b8c339b5d/src/core/filter/auth/client_auth_filter.cc#L205 if ((strlen($hostname) > 4) && (substr($hostname, -4) === ":443")) { $hostname = substr($hostname, 0, -4); } From 4a5f792b68a09857591ec7fb9e020b961cf133ac Mon Sep 17 00:00:00 2001 From: Wesley Silva Date: Mon, 23 Jun 2025 18:34:16 -0300 Subject: [PATCH 2/2] fix: corrigindo caminho ssl roots --- src/lib/BaseStub.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/BaseStub.php b/src/lib/BaseStub.php index 5f7d2a9..97d0b24 100644 --- a/src/lib/BaseStub.php +++ b/src/lib/BaseStub.php @@ -46,7 +46,7 @@ public function __construct($hostname, $opts, $channel = null) if (!method_exists('Grpc\ChannelCredentials', 'isDefaultRootsPemSet') || !ChannelCredentials::isDefaultRootsPemSet()) { $ssl_roots = file_get_contents( - dirname(__FILE__).'/../../../../etc/roots.pem' + dirname(__FILE__).'/../../etc/roots.pem' ); ChannelCredentials::setDefaultRootsPem($ssl_roots); }