feat(libkernel): serve the sandbox CA bundle from host TLS roots #5280
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5280"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by santhoshkumar-dev on 2026-10-13T16:24:32Z.
What
ProsperoRadio (PPSA99001) and SwanStation (PPSA98510) load
/<sandbox word>/common/cert/CA_LIST.certhrough bundled OpenSSL and cannot complete HTTPS requests when it is absent (#5001). This proposes serving a host-derived PEM bundle at that exact path. The host-trust design still awaits the maintainer decision in #5001.The branch has two feature commits rebased onto
main8856f180c, with no merge commits. The first carries @screamm's implementation, as offered in #5001, retaining its author and coauthor attribution. The second adds:Linux retains the original implementation's
SSL_CERT_FILE/distribution-bundle selection. The bundle is created lazily as a read-only cache in the run directory; Windows certificate stores are opened read-only. Console CA contents/file format and complete Windows chain policy remain unverified and recorded in technical debt. Windows usage semantics follow CertGetEnhancedKeyUsage.Tested
Rebased head
f2ceed091, validated in the isolated PR checkout:BUILD_TESTING=ON: five tests pass (guest_sandbox_certificates,guest_sandbox_certificate_trust,guest_sandbox_random_word,guest_path_case,guest_working_directory).guest_working_directory,guest_exit_orderandguest_path_lifetime.git diff --checkpass. The certificate implementation and both certificate test files are byte-identical to the previous PR head5f1b1fe01. The rebase preserves current-main path resolution, #6230, the merged #4994 path-service lifetime fix and the host-stream source registration.Earlier validation on
e8f179733:8fd97c296, the Windows/Linux sandbox/path tests passed again.e6740bc6) and #4525 (5db1d8d5), excluded from this PR; #5025 was already on the base. With no manually supplied CA file and a 60-second limit, ProsperoRadio 01.000.010 downloaded three catalog pages and accepted 28,865 stations. SwanStation 1.2.4 wrote its game database and installed 1.2.5 (249 files), then reported Vulkan device loss; no rendering/gameplay stability claim. Both used an automatically generated 66-certificate bundle.Independent contributor validation, attributed to @babyhuey's report on
8fd97c29merged ontomainf40b6930, Windows 11 / RTX 3080 / WinLibs GCC 15.2:No PS5 hardware or Linux title run was performed locally. Full Windows/Linux CI requires maintainer dispatch under the repository's workflow policy.
Checklist
main; no other open PR implements the same functionsImported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-14T04:25:51Z.
Two more titles on Windows 11 (RTX 3080, WinLibs GCC 15.2, Release), with this PR (8fd97c29) merged onto
mainf40b6930(clean merge), default flags:mainits HTTPS requests fail withca=/gkbHtXc3Wq/common/cert/CA_LIST.cer (MISSING)andcurl 77, so it stays in its offline mode. With this PR it logsca=... (found)(libcurl 8.18.0, OpenSSL 3.5.2) andlichess probe status=200, with nocurl 77. The daily puzzle (rating 2042, a real position) and Lichess TV (a live board) load, and the Offline pill gives way to "Not signed in".page offset=0 ... objects=10000 accepted=9512throughoffset=60000 ... total=59440) into a 28.6 MB SQLite file. On the next start it shows "59,440 stations" with the Popular grid filled, at about 30 fps.The bundle written to
cert_cache/CA_LIST.cerwas 93,926 bytes.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T06:39:04Z.
Please rebase on current
maininstead of merging it in; the branch has two merge commits. Serving the host's trust store as the console'sCA_LIST.ceris a design call that is still open in #5001, so this waits on that.Imported from boykopovar/AnyPS5. Originally posted by santhoshkumar-dev on 2026-10-14T08:23:20Z.
Rebased onto
main31bfc4e86; head is5f1b1fe01. There are now two feature commits and no merge commits, with @screamm's author/coauthor attribution preserved. The certificate implementation and both certificate test files are unchanged from the previous PR head.Fresh-checkout validation passes: four Windows sandbox/path tests, the three applicable Ubuntu/WSL2 tests, conventions and the whitespace check. The description now distinguishes these checks from the earlier full build/title runs and credits @babyhuey's additional ProsperoLichess and ProsperoRadio results.
Agreed that serving host trust as
CA_LIST.cerstill awaits the design decision in #5001. This update addresses the branch history and does not claim that design is approved.The overlap with #4994 is adjacent to
Directories()inGeneral.cpp: that PR retains the path services through exit; this one adds the exact-path provider. There is no implementation dependency. @krishalivaibhav, I can rebase this after #4994 if that should land first; please confirm the preferred merge order while #5001 remains pending.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by santhoshkumar-dev on 2026-10-14T20:48:15Z.
@oneandonlydean, rebased this PR onto current
main8856f180c; the new head isf2ceed091, with two feature commits and no merge commits. The latest path resolver and #6230 are preserved, along with #4994's path-service lifetime fix,HostStreams.cppregistration and current Windows dependencies.Validation on this head passes: five Windows tests and six Ubuntu/WSL2 tests, including the Linux
guest_path_lifetimeandguest_exit_orderregressions, plus conventions and the whitespace check. The certificate implementation and its two test files are unchanged from5f1b1fe01. The provider still serves this CA file on read-only opens, which current main routes through module lookup.The new head's conventions check passes; its automatic build checks are running. Full Windows/Linux CI is skipped under the maintainer-dispatch policy and requires a maintainer dispatch.
The overlap scan finds no conflicting lines with other open PRs. #6061 is separate drive-letter path hardening, but it also changes resolver helpers this provider uses. If that refactor lands first, please retain this exact-path provider lookup when combining the changes; it is not listed as a functional dependency.
The design question in #5001 is also still open: host-derived trust at this exact guest path, or a shipped bundle? The title reports show that PEM works with bundled OpenSSL, while the console format and full Windows chain policy remain unverified in technical debt. If you approve the host-derived approach, please dispatch full Windows/Linux CI for PR 5280.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by santhoshkumar-dev on 2026-10-15T11:08:17Z.
@oneandonlydean, quick ping on the #5001 design decision: should AnyPS5 expose host-derived trust at
CA_LIST.cer, or ship a CA bundle instead?#5280 is rebased onto
main8856f180c; GitHub reports it clean and mergeable. Five Windows tests, six Linux tests and the automatic checks pass. The full Windows/Linux suites were skipped and need maintainer dispatch. The console CA format and complete Windows chain policy remain unknown, so I’m waiting on your direction before calling this ready to merge.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:07:30Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libc/src/General.cppL172-175Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libc/src/General.cppcore/libs/prx/libkernel/CMakeLists.txtdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libc/src/General.cppcore/libs/prx/libkernel/CMakeLists.txtdocs/dev/debt/libkernel.mdcore/libs/prx/libc/src/General.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/CMakeLists.txtdocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mdcore/libs/prx/libc/src/General.cppImported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T19:27:34Z.
Review: COMMENTED
Static review on macOS, head
f2ceed091, of the non-Windows branch ofTrustedRoots.cpp/SandboxCertificates.cpp. Checked on the host, not with this PR's binary.On macOS the provider finds no bundle, so
CA_LIST.cerstays missing. None of the three fixed candidates exists on macOS 27.2:macOS ships its PEM bundle at
/etc/ssl/cert.pem. That is also the path FreeBSD, OpenBSD/LibreSSL and Alpine use. WithoutSSL_CERT_FILEset, a macOS run behaves likemain(CA_LIST.cer (MISSING)). The tests still pass because they setSSL_CERT_FILE, so they don't catch this.Adding
"/etc/ssl/cert.pem"tocandidateswould cover macOS. One caveat for the debt note: on macOS that file is a static snapshot. It does not reflect roots added to or distrusted in the Keychain, which is the same kind of gap the Windows section already notes for CTL restrictions.This depends on the #5001 design decision, so treat it as input for whichever option is chosen.
Written with AI assistance (Claude Code). I ran the check above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by coltken95 on 2026-10-16T00:02:49Z.
Linux title runs (CachyOS, RTX 2070, NVIDIA driver), with f2ceed091 merged into main
5d9dcc42d. Host bundle:/etc/ssl/certs/ca-certificates.crt(→tls-ca-bundle.pem).ProsperoTV (PPSA99003):
[ProsperoTV][http] https://iptv-org.github.io/iptv/index.m3u: Problem with the SSL CA cert (path? access rights?) (error adding trust anchors from file: /gkbHtXc3Wq/common/cert/CA_LIST.cer)cert_cache/CA_LIST.cer(185 KB, read-only) is written, and the channel list loads (channel list shown).PSXS5 (PPSA97510):
net: https://raw.githubusercontent.com/.../gamedb.yaml -> curl 77, http 0, thengamedb: download failedgamedb: index writtenandcert_cache/CA_LIST.ceris written (game list shown).Both titles are the ones #5001 listed as expected to follow but not verified.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by iDiesIrae-Req on 2026-10-16T04:29:14Z.
Windows title run for this PR: SwanStationPS5 (PPSA98510) 1.3.7 from the homebrew catalog, RTX 4070 Laptop, Windows 11 26300, WinLibs GCC 15.2.0 r7.
api.github.com)raw.githubusercontent.com)main5d9dcc42dcurl 77, http 0gamedb: download failedmain5d9dcc42d+ f2ceed091update: latest 1.3.7, this 1.3.7gamedb: index written(freshcache/gamedb.txt, 1.1 MB)With the PR the run directory gets
cert_cache/CA_LIST.cer(99,724 bytes), and the title runs on at 60 FPS.One thing to be aware of for the #5001 decision: during the passing run, Avast's HTTPS scanning was on, so both hosts were served a chain issued by "Avast Web/Mail Shield Root". It still verified, because that root is in the current user's ROOT store and this PR exports that store. So with host-derived trust, a title trusts whatever the PC trusts, including local TLS-inspection roots. A title that ships its own CA bundle instead (PSBox Cloud Gaming PPSA99810,
assets/cacert.pem) rejects the same interception (certificate refused) and works once HTTPS scanning is off.The
mainfailure doesn't depend on Avast: themainrow above was run with HTTPS scanning off, and it's curl's "can't read the CA file" (77).AI-assisted: yes, Claude Code ran the builds and tests; I reviewed the results.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-16T23:54:25Z.
Host-derived trust is fine: serving the host's trust store as
CA_LIST.cerunblocks these titles, and it's tested on Linux and Windows. Please rebase; it conflicts with main again.Imported from boykopovar/AnyPS5. Originally posted by santhoshkumar-dev on 2026-10-17T02:33:29Z.
@oneandonlydean, thanks for approving the host-derived approach. Rebased onto
main9bf01db66and pushed headeb26fb97fwith--force-with-lease. GitHub reports it mergeable. The branch still has two feature commits and no merge commits, with the original author/coauthor attribution preserved.The Windows link conflict is resolved by retaining both main's
iphlpapidependency and this PR'scrypt32. Current path/archive resolution and path-service lifetime behavior are preserved. I also addressed the macOS review by adding/etc/ssl/cert.pemand documenting that this static bundle does not reflect Keychain trust changes.Fresh validation on Debian 13, GCC 14.2.0, Release: the affected
libcandlibkernellibraries build in an isolated out-of-tree project using their repository CMake source lists and pinned ZArchive/zstd dependencies. All seven existing sandbox/path/exit regressions pass, along with conventions andgit diff --check. Windows trust code and both certificate test files are unchanged fromf2ceed091; no native Windows/macOS build or title run was repeated for this head.Automatic build checks are still running. Full Linux/Windows jobs were skipped under the maintainer-dispatch policy; please dispatch full CI for this head.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T03:36:05Z.
Merged, thanks @santhoshkumar-dev. One non-blocking follow-up if you have time: on Linux and macOS the bundle is served as the first file found (
SSL_CERT_FILEfirst). A user-pointedSSL_CERT_FILEcan hold more than certificates, such as a private key next to the chain, so it would be safer to copy only theBEGIN CERTIFICATE...END CERTIFICATEblocks into what the guest sees. A small separate PR is fine.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T04:11:32Z.
I opened PR #7007 for this follow-up. It filters the host bundle to complete certificate blocks and adds a regression with surrounding metadata and private-key blocks. The target builds and conventions/registration checks pass; focused CTest is blocked before assertions by this Linux runner's CPU feature guard, so I recorded that limitation and a passing standalone extraction harness in the PR.