Skip to content

Harden Post fallback TLS verification#625

Open
SNO7E-G wants to merge 1 commit intogoogle:mainfrom
SNO7E-G:fix/post-fallback-tls-verification
Open

Harden Post fallback TLS verification#625
SNO7E-G wants to merge 1 commit intogoogle:mainfrom
SNO7E-G:fix/post-fallback-tls-verification

Conversation

@SNO7E-G
Copy link
Copy Markdown
Contributor

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

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

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