Skip to content

fix: modernize Telegram transport for PHP 8 and Guzzle 7 - #1

Open
MiRHaDi wants to merge 2 commits into
masterfrom
fix/verify-tls-certificates
Open

MiRHaDi wants to merge 2 commits into
masterfrom
fix/verify-tls-certificates

Conversation

@MiRHaDi

@MiRHaDi MiRHaDi commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner

The historical client disabled TLS verification, only supported Guzzle 6, and passed structured Bot API values directly to multipart encoding. This update keeps certificate verification enabled, disables redirects, and targets PHP 8.2+ with Guzzle 7.10+.

  • Reuses an optionally injected Guzzle client so real HTTP middleware can be tested offline.
  • JSON-encodes structured parameters, serializes booleans explicitly, omits null fields, and preserves upload streams.
  • Validates success/error response envelopes and throws a clear exception for malformed responses; valid Telegram errors retain the Response/NotOkException contract.
  • Preserves newly added Telegram response fields without PHP dynamic-property deprecations and makes the nullable constructor explicit.
  • Adds offline Guzzle tests and a pinned-action CI matrix for PHP 8.2, 8.4, 8.5 on Linux and 8.3 on Windows.
  • Corrects the README example and documents the compatibility change and unreleased fork status.

Validation: local PHP 8.3 contract tests, real Guzzle MockHandler tests, PHP syntax checks, strict Composer validation, and Composer audit passed. Installed Guzzle 7.15.5; no known advisories reported for the resolved dependencies. The new-field regression test failed before the PHP compatibility fix and passed afterward. CI results are attached to this PR. No live bot token or Telegram message was used.

Compatibility: PHP <8.2 / Guzzle 6 are no longer supported by this maintenance branch. The historical typed wrappers are not a complete model of all current Bot API methods; generic Api::request() remains available. No Packagist release has been published.

@MiRHaDi MiRHaDi changed the title fix: enable TLS certificate verification fix: modernize Telegram transport for PHP 8 and Guzzle 7 Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant