Skip to content

Harden Post fallback TLS verification#625

Merged
rowan-m merged 1 commit into
google:mainfrom
SNO7E-G:fix/post-fallback-tls-verification
Apr 27, 2026
Merged

Harden Post fallback TLS verification#625
rowan-m merged 1 commit into
google:mainfrom
SNO7E-G:fix/post-fallback-tls-verification

Conversation

@SNO7E-G

@SNO7E-G SNO7E-G commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Hi!
This PR hardens the fallback Post request method by explicitly enabling TLS peer verification and peer-name verification in the stream context. This keeps fallback behavior aligned with secure transport expectations when curl is unavailable.

The fallback path is used in environments without curl, so it should still enforce strict certificate checks. Without explicit SSL options, behavior can depend on runtime defaults.

What changed
Added ssl context options:

  • verify_peer => true
  • verify_peer_name => true
  • Expanded Post request-method test coverage to assert these SSL options are present and true.

Files

  • [Post.php]
  • [PostTest.php]

Validation

  • PHPUnit passed: 69 tests, 190 assertions
  • PHPStan passed with no errors
  • PHP-CS-Fixer check passed for modified files

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same — SNO7E-G:fix/post-fallback-tls-verification into google:main

@rowan-m

rowan-m commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Tested local demo. 👍

@rowan-m rowan-m merged commit 45689d9 into google:main Apr 27, 2026
7 checks passed
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.

3 participants