Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP: Implement TLS 1.2 to decrypt https:// and ssl:// traffic and translate it into fetch() #1926

Merged
merged 46 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
f2441b5
Rebase SSL support
adamziel Oct 16, 2024
a0eb8c1
Certificate generation and draft TLS 1.2 handshake
adamziel Oct 18, 2024
8a88969
Working certificate generation
adamziel Oct 18, 2024
35d0aea
Handshake works all the way up to key exchange
adamziel Oct 18, 2024
2afab8e
Add elliptic curves extensions
adamziel Oct 19, 2024
4e149c8
Progress on verifying client finished
adamziel Oct 20, 2024
37a42cd
Track handshake messages at the class level
adamziel Oct 20, 2024
7572f1c
Verify PRF implementation
adamziel Oct 20, 2024
ae3cd8b
Verify PRF implementation
adamziel Oct 20, 2024
db0e317
Working decryption of client finish!
adamziel Oct 20, 2024
4b322cc
Successful server finish message
adamziel Oct 20, 2024
ea04c35
Working rewriting the request as fetch()
adamziel Oct 20, 2024
b548245
Seemingly working child certificate verification. Now there's an encr…
adamziel Oct 21, 2024
000075d
Working dynamic per-domain child certificate!
adamziel Oct 21, 2024
82501b3
Initial code cleanup
adamziel Oct 22, 2024
c079502
Clean up the bulk of TLS_1_2_Connection
adamziel Oct 22, 2024
8326326
TLS_1_2_Connection largely cleaned up
adamziel Oct 22, 2024
093b671
Replace encodeFromClient with encodeForClient
adamziel Oct 22, 2024
c5785e3
Cleanup the code by and large
adamziel Oct 22, 2024
29cb007
Fix warnings in 13_signature_algorithms
adamziel Oct 22, 2024
e9a3529
Merge branch 'trunk' into ssl-network-brodge-wrap
adamziel Oct 22, 2024
66e4fdc
Remove the temporary test files
adamziel Oct 22, 2024
28f5937
Resolve conflicts, rebuild php 8.3
adamziel Oct 22, 2024
560e7e6
Make the TLS proxy optional
adamziel Oct 22, 2024
c588dce
Adjust docstrings, rebuild PHP 8.1
adamziel Oct 22, 2024
f12e350
Feed the network response back to PHP in 16K chunks
adamziel Oct 22, 2024
833ef58
Only tunnel the traffic through TLS when networking is enabled
adamziel Oct 22, 2024
02a1f5f
Rebuild more PHP versions
adamziel Oct 22, 2024
ff15464
Rebuild all JSPI PHP versions
adamziel Oct 22, 2024
f802a3d
Rebuild asyncify PHP
adamziel Oct 22, 2024
02cf2b2
Merge branch 'trunk' into ssl-network-brodge-wrap
adamziel Oct 22, 2024
7db8b78
Clean up the Emscripten <-> TLS Connection glue layer, use streams
adamziel Oct 22, 2024
907567c
Upgrade the cache action to v4
adamziel Oct 22, 2024
509c5db
Docstrings
adamziel Oct 22, 2024
7fb046d
Additional docstrings
adamziel Oct 22, 2024
8f7b9b0
Send empty data chunk before closing the WS, adjust the runtime to ge…
adamziel Oct 22, 2024
c460ee9
Unit test certificate generation
adamziel Oct 23, 2024
a17fb35
Unit test TCP over Fetch
adamziel Oct 23, 2024
c0faa72
Polish log messages
adamziel Oct 23, 2024
b333e23
Remove logger.debug() statements
adamziel Oct 23, 2024
e99eaa3
Remove unused import
adamziel Oct 23, 2024
8a19dc4
Clean up deps
adamziel Oct 23, 2024
4133281
Adjust cert generation unit tests
adamziel Oct 23, 2024
4aeb0c2
Adjust vitest matchers
adamziel Oct 23, 2024
171136d
Clarify the implementation via substantial docstrings
adamziel Oct 23, 2024
f2e1eb2
Add E2E tests
adamziel Oct 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/prepare-playground/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ runs:
node-version: ${{ inputs.node-version }}
- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v2
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
with:
submodules: true
- uses: ./.github/actions/prepare-playground
with:
node-version: 22
- run: node --expose-gc node_modules/nx/bin/nx affected --target=test --configuration=ci
# Most of these tests pass locally but the process is crashing
# on the CI runner.
Expand Down
102 changes: 45 additions & 57 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,168 +4,156 @@ All notable changes to this project are documented in this file by a CI job
that runs on every NPM release. The file follows the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
format.

## [v1.0.4] (2024-10-21)
## [v1.0.4] (2024-10-21)

### Enhancements

- Support CORS proxy rate-limiting. ([#1879](https://github.com/WordPress/wordpress-playground/pull/1879))
- Support CORS proxy rate-limiting. ([#1879](https://github.com/WordPress/wordpress-playground/pull/1879))

### Blueprints

- Allow multisites to load wp-admin pages with the landingPage attribute. ([#1913](https://github.com/WordPress/wordpress-playground/pull/1913))
- Allow multisites to load wp-admin pages with the landingPage attribute. ([#1913](https://github.com/WordPress/wordpress-playground/pull/1913))

### Tools


#### GitHub integration

- Blueprints: Use `?` instead of `/` to CORS Proxy URLs. ([#1899](https://github.com/WordPress/wordpress-playground/pull/1899))
- Blueprints: Use `?` instead of `/` to CORS Proxy URLs. ([#1899](https://github.com/WordPress/wordpress-playground/pull/1899))

#### Import/Export

- Kickoff Data Liberation: Let's Build WordPress-first Data Migration Tools. ([#1888](https://github.com/WordPress/wordpress-playground/pull/1888))
- Kickoff Data Liberation: Let's Build WordPress-first Data Migration Tools. ([#1888](https://github.com/WordPress/wordpress-playground/pull/1888))

### Experiments


#### File Synchronization

- [Remote] Preserve PHP constants when saving a temporary site. ([#1911](https://github.com/WordPress/wordpress-playground/pull/1911))
- [Remote] Preserve PHP constants when saving a temporary site. ([#1911](https://github.com/WordPress/wordpress-playground/pull/1911))

### Website

- Do not display "You have no Playgrounds" message before loading the site. ([#1912](https://github.com/WordPress/wordpress-playground/pull/1912))
- Fix build error that only appeared during deployment. ([#1896](https://github.com/WordPress/wordpress-playground/pull/1896))
- Fix use of secrets on WP Cloud site. ([#1909](https://github.com/WordPress/wordpress-playground/pull/1909))
- Maintain Query API parameters on temporary Playground settings update. ([#1910](https://github.com/WordPress/wordpress-playground/pull/1910))
- Stop adding all CORS proxy files to website build. ([#1895](https://github.com/WordPress/wordpress-playground/pull/1895))
- Stop responding with default MIME type. ([#1897](https://github.com/WordPress/wordpress-playground/pull/1897))
- Stop short-circuiting web host PHP execution. ([#1898](https://github.com/WordPress/wordpress-playground/pull/1898))
- Fix progress reporting during Playground load. ([#1915](https://github.com/WordPress/wordpress-playground/pull/1915))
- Include CORS proxy with website builds. ([#1880](https://github.com/WordPress/wordpress-playground/pull/1880))
- [Blueprints] Stop escaping landingPage URLs when loading WP Admin. ([#1891](https://github.com/WordPress/wordpress-playground/pull/1891))
- Do not display "You have no Playgrounds" message before loading the site. ([#1912](https://github.com/WordPress/wordpress-playground/pull/1912))
- Fix build error that only appeared during deployment. ([#1896](https://github.com/WordPress/wordpress-playground/pull/1896))
- Fix use of secrets on WP Cloud site. ([#1909](https://github.com/WordPress/wordpress-playground/pull/1909))
- Maintain Query API parameters on temporary Playground settings update. ([#1910](https://github.com/WordPress/wordpress-playground/pull/1910))
- Stop adding all CORS proxy files to website build. ([#1895](https://github.com/WordPress/wordpress-playground/pull/1895))
- Stop responding with default MIME type. ([#1897](https://github.com/WordPress/wordpress-playground/pull/1897))
- Stop short-circuiting web host PHP execution. ([#1898](https://github.com/WordPress/wordpress-playground/pull/1898))
- Fix progress reporting during Playground load. ([#1915](https://github.com/WordPress/wordpress-playground/pull/1915))
- Include CORS proxy with website builds. ([#1880](https://github.com/WordPress/wordpress-playground/pull/1880))
- [Blueprints] Stop escaping landingPage URLs when loading WP Admin. ([#1891](https://github.com/WordPress/wordpress-playground/pull/1891))

### Bug Fixes


#### Boot Flow

- Prefer pretty permalinks like WP install does. ([#1832](https://github.com/WordPress/wordpress-playground/pull/1832))
- Prefer pretty permalinks like WP install does. ([#1832](https://github.com/WordPress/wordpress-playground/pull/1832))

### Various

- Improve self-host documentation. ([#1884](https://github.com/WordPress/wordpress-playground/pull/1884))
- Improve self-host documentation. ([#1884](https://github.com/WordPress/wordpress-playground/pull/1884))

### Contributors

The following contributors merged PRs in this release:

@adamziel @ashfame @bgrgicak @brandonpayton


## [v1.0.3] (2024-10-14)
## [v1.0.3] (2024-10-14)

### Enhancements

- Website: Remove unused React components. ([#1887](https://github.com/WordPress/wordpress-playground/pull/1887))
- Website: Remove unused React components. ([#1887](https://github.com/WordPress/wordpress-playground/pull/1887))

### Tools


#### Blueprints Builder

- Blueprints sidebar section for single-click Playground presets. ([#1759](https://github.com/WordPress/wordpress-playground/pull/1759))
- Blueprints sidebar section for single-click Playground presets. ([#1759](https://github.com/WordPress/wordpress-playground/pull/1759))

### Website

- Replace 100vh with 100dvh to fix an "unscrollable" state on mobile devices. ([#1883](https://github.com/WordPress/wordpress-playground/pull/1883))
- Use modal for Site settings form on mobile – mobile Safari l…. ([#1885](https://github.com/WordPress/wordpress-playground/pull/1885))
- Replace 100vh with 100dvh to fix an "unscrollable" state on mobile devices. ([#1883](https://github.com/WordPress/wordpress-playground/pull/1883))
- Use modal for Site settings form on mobile – mobile Safari l…. ([#1885](https://github.com/WordPress/wordpress-playground/pull/1885))

### Contributors

The following contributors merged PRs in this release:

@adamziel


## [v1.0.2] (2024-10-09)
## [v1.0.2] (2024-10-09)

### PHP WebAssembly

- PHP.wasm: Load correct php.wasm paths in the built Node.js packages. ([#1877](https://github.com/WordPress/wordpress-playground/pull/1877))
- PHP.wasm: Load correct php.wasm paths in the built Node.js packages. ([#1877](https://github.com/WordPress/wordpress-playground/pull/1877))

### Contributors

The following contributors merged PRs in this release:

@adamziel

## [v1.0.1] (2024-10-09)

## [v1.0.1] (2024-10-09)




## [v1.0.0] (2024-10-09)
## [v1.0.0] (2024-10-09)

### Blueprints

- Directory Resources. ([#1793](https://github.com/WordPress/wordpress-playground/pull/1793))
- Login step – handle passwordless autologin via a PHP mu-plugin. ([#1856](https://github.com/WordPress/wordpress-playground/pull/1856))
- Directory Resources. ([#1793](https://github.com/WordPress/wordpress-playground/pull/1793))
- Login step – handle passwordless autologin via a PHP mu-plugin. ([#1856](https://github.com/WordPress/wordpress-playground/pull/1856))

### Tools


#### Blueprints

- GitDirectoryResource. ([#1858](https://github.com/WordPress/wordpress-playground/pull/1858))
- GitDirectoryResource: Accept "/", "", "." as root paths. ([#1860](https://github.com/WordPress/wordpress-playground/pull/1860))
- GitDirectoryResource. ([#1858](https://github.com/WordPress/wordpress-playground/pull/1858))
- GitDirectoryResource: Accept "/", "", "." as root paths. ([#1860](https://github.com/WordPress/wordpress-playground/pull/1860))

#### GitHub integration

- Native git support: LsRefs(), sparseCheckout(), GitPathControl. ([#1764](https://github.com/WordPress/wordpress-playground/pull/1764))
- Native git support: LsRefs(), sparseCheckout(), GitPathControl. ([#1764](https://github.com/WordPress/wordpress-playground/pull/1764))

#### Website

- Add core-pr and gutenberg-pr Query API parameters. ([#1761](https://github.com/WordPress/wordpress-playground/pull/1761))
- Add core-pr and gutenberg-pr Query API parameters. ([#1761](https://github.com/WordPress/wordpress-playground/pull/1761))

### PHP WebAssembly

- Refreshless website deployments – load remote.html using the network-first strategy. ([#1849](https://github.com/WordPress/wordpress-playground/pull/1849))
- JSPI: Pass all unit tests, remove stale PHP builds. ([#1876](https://github.com/WordPress/wordpress-playground/pull/1876))
- [Remote] Remove the "light" PHP.wasm bundle and only ship the "kitchen-sink" build. ([#1861](https://github.com/WordPress/wordpress-playground/pull/1861))
- Refreshless website deployments – load remote.html using the network-first strategy. ([#1849](https://github.com/WordPress/wordpress-playground/pull/1849))
- JSPI: Pass all unit tests, remove stale PHP builds. ([#1876](https://github.com/WordPress/wordpress-playground/pull/1876))
- [Remote] Remove the "light" PHP.wasm bundle and only ship the "kitchen-sink" build. ([#1861](https://github.com/WordPress/wordpress-playground/pull/1861))

### Website

- Restore the single-click "Edit Settings" flow. ([#1854](https://github.com/WordPress/wordpress-playground/pull/1854))
- Restrict CORS proxy to requests from Playground website origin. ([#1865](https://github.com/WordPress/wordpress-playground/pull/1865))
- Restore the single-click "Edit Settings" flow. ([#1854](https://github.com/WordPress/wordpress-playground/pull/1854))
- Restrict CORS proxy to requests from Playground website origin. ([#1865](https://github.com/WordPress/wordpress-playground/pull/1865))

#### Documentation

- Add /release redirect to WP beta/RC blueprint. ([#1866](https://github.com/WordPress/wordpress-playground/pull/1866))
- Add /release redirect to WP beta/RC blueprint. ([#1866](https://github.com/WordPress/wordpress-playground/pull/1866))

### Internal

- Make isomorphic-git submodule use https, not ssh. ([#1863](https://github.com/WordPress/wordpress-playground/pull/1863))
- Make isomorphic-git submodule use https, not ssh. ([#1863](https://github.com/WordPress/wordpress-playground/pull/1863))

### Bug Fixes

- [CLI] Fix `isWordPressInstalled()` in CLI by inlining the auto_login.php in index.ts instead of using import ?raw. ([#1869](https://github.com/WordPress/wordpress-playground/pull/1869))
- [CLI] Fix `isWordPressInstalled()` in CLI by inlining the auto_login.php in index.ts instead of using import ?raw. ([#1869](https://github.com/WordPress/wordpress-playground/pull/1869))

### Various

- Add documentation around the GPL license and implications for contribution. ([#1776](https://github.com/WordPress/wordpress-playground/pull/1776))
- Allow installing Plugins/Themes into an arbitrary folder. ([#1803](https://github.com/WordPress/wordpress-playground/pull/1803))
- Improve documentation. ([#1862](https://github.com/WordPress/wordpress-playground/pull/1862))
- [Website] Fix "undefined" as className. ([#1870](https://github.com/WordPress/wordpress-playground/pull/1870))
- Add documentation around the GPL license and implications for contribution. ([#1776](https://github.com/WordPress/wordpress-playground/pull/1776))
- Allow installing Plugins/Themes into an arbitrary folder. ([#1803](https://github.com/WordPress/wordpress-playground/pull/1803))
- Improve documentation. ([#1862](https://github.com/WordPress/wordpress-playground/pull/1862))
- [Website] Fix "undefined" as className. ([#1870](https://github.com/WordPress/wordpress-playground/pull/1870))

### Contributors

The following contributors merged PRs in this release:

@adamziel @ajotka @bgrgicak @brandonpayton @dd32 @n8finch


## [v0.9.46] (2024-10-07)

### Enhancements
Expand Down
8 changes: 7 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"recompile:php:web:jspi:7.2": "nx recompile-php:jspi php-wasm-web -- --PHP_VERSION=7.2 ",
"recompile:php:web:jspi:7.1": "nx recompile-php:jspi php-wasm-web -- --PHP_VERSION=7.1 ",
"recompile:php:web:jspi:7.0": "nx recompile-php:jspi php-wasm-web -- --PHP_VERSION=7.0 ",
"recompile:php:web:asyncify:all": "nx recompile-php:asyncify php-wasm-web",
"recompile:php:web:asyncify:all": "nx recompile-php:asyncify:all php-wasm-web",
"recompile:php:web:asyncify:8.3": "nx recompile-php:asyncify php-wasm-web -- --PHP_VERSION=8.3 ",
"recompile:php:web:asyncify:8.2": "nx recompile-php:asyncify php-wasm-web -- --PHP_VERSION=8.2 ",
"recompile:php:web:asyncify:8.1": "nx recompile-php:asyncify php-wasm-web -- --PHP_VERSION=8.1 ",
Expand Down
Loading
Loading