fix(ssl): retain loaded certificate authorities #3897
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3897"
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 eliasbruno124-dev on 2026-10-11T18:59:13Z.
What
The Last of Us Part II Remastered (PPSA15508/01.002.000) stops at
sceSslLoadCertduring startup. This change parses and retains the supplied CA chain and optional client credentials per SSL context, exposes owned DER snapshots, and releases allocations on unload/free/term. Invalid imports leave existing credentials intact. Loading credentials does not establish a TLS connection or authenticate a peer; unsupported operations still throw.Adopts the maintainer's exact rebased commit
b737308e, directly on the final #5226 commit8e688966, now merged into main. The shared registry and certificate/connection lifetime regression are retained.sceSslConnect,sceSslReadandsceSslWriteremain explicitNotImplemented_nid_no_patchstubs; this PR adds no TLS transport. SSL and pool-stat debt stays in the matching library files;TechnicalDebt.mdis unchanged from the parent.Dependency
Mbed TLS 3.6.7 is pinned as a source submodule for X.509 DER/PEM parsing and client certificate/private-key matching. Main has no existing certificate parser; its media dependencies do not provide these operations. The link uses
mbedx509,mbedcryptoandp256m, without Everest or the Mbed TLS transport library.The linked Mbed TLS and p256-m sources offer Apache-2.0 OR GPL-2.0-or-later; the Apache-2.0 option is available here, and upstream license files are retained. The pinned Mbed TLS/framework revisions contain 47,433,926 tracked source bytes, excluding Git history, generated files and build outputs. In the earlier October 14 Windows Release comparison, the patched, unstripped SSL DLL grows from 79,106 bytes with #5226 alone to 720,093 bytes with certificate support (+640,987). This historical measurement covers the whole certificate contribution; it is not a fresh size comparison of the maintainer's rebase.
Tested
Windows 11, WinLibs GCC 15.2.0, Release, exact
b737308e:guest_ssl_load,guest_ssl,guest_http,guest_http2,guest_http_response_header,guest_memory_pool_statsandguest_sce_net, with a 30-second per-test limit.sceSslLoadCert not implemented; restoring the certificate implementation passes all seven. That control predates this rebase. The certificate regression and its fixtures are unchanged; all seven tests were rerun onb737308e.git diff --checkpass. Linux was not tested locally.The same-input TLOU comparison used main
0b6d033b8plus #5226, changing only the SSL DLL. Baseline aborts atsceSslLoadCert. Candidate3c96928e4returns 0 for the same original 1,408-byte CA; the merged #3925 then completes HTTP2 send/wait with the offline result0x80436063. The next stop is a null read at original VA0x1b60f2, before VideoOutOpen or any submitted frame. The certificate code and its fixtures remain unchanged by the maintainer's latest rebase; its SSL changes preserve the final parent's explicit transport stubs. The runtime and focused tests were rebuilt onb737308e, but this title observation remains attributed to3c96928e4; it was not rerun onb737308e.The original title files were preserved, using recorded plain-SELF staging and same-name resource mappings outside the dump. This is not a container-identical direct-dump launch or a menu, gameplay or performance result. Bring-up: #5468.
Console error precedence, repeated-import behavior, snapshot lifetime and exact allocator overhead remain unmeasured and are documented as technical debt.
Checklist
main; no other open PR implements the same certificate operationsImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T18:59:37Z.
Progress report (
23e93c0→b737308)📈 System libraries: 88.33% (+0.03%, +1 implemented functions)
✅ 1 implemented
sceSslLoadCertImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T20:47:07Z.
Review: DISMISSED
Thanks for this. Not mergeable as is:
mainand conflicts indocs/dev/TechnicalDebt.md. Main has since split that page: entries about one library now live indocs/dev/debt/<library>.mdunder the same sections. The diff rewrites the old single file and would revert that split. Please rebase on currentmainand put thelibSceSsllines in the matchingdebt/file, leavingTechnicalDebt.mdas on main. I can't push the rebase myself because "Allow edits from maintainers" is off on the PR.3rdparty/mbedtlsas a new third-party dependency (new submodule, new CMake wiring). Please mention in the PR body why an existing dependency isn't enough and its license/size impact, so the maintainers can OK it.After the rebase, please rerun
guest_ssl_loadand the other focused tests on the rebased head.Imported from boykopovar/AnyPS5. Originally posted by eliasbruno124-dev on 2026-10-13T20:46:40Z.
Rebased in f76d8c6f onto
0aa4cb1c. The SSL and shared pool-stat debt entries are in the matching library files; TechnicalDebt.md is unchanged from main, and newer throwing exports are preserved.The full Windows Release build, libs and all six focused tests pass on the rebased head. The certificate-load regression fails with main's Export.cpp and passes after restoring the implementation; the final rebase changes neither side. Conventions, including the updated PR body, and diff checks pass. Linux was not tested locally.
The description now explains why a certificate parser is needed, the Mbed TLS/p256-m license options and the measured size impact: 47,433,926 tracked source bytes including the framework, and +640,288 bytes for the complete unstripped Windows SSL binary. The actual link excludes Everest and the TLS transport library. TLOU's current startup observation is in #5468; it is not yet rendering.
#5226 separately changes the SSL context registry for connection operations. Do you prefer that to land first? I can rebase this certificate work over it; it is not included in this branch.
Maintainer edits remain disabled at the owner's request; I will handle any further corrections here.
Prepared with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T20:50:31Z.
I recommend integrating #5226 before this certificate change, then rebasing this PR onto it. There is no behavioral dependency for
sceSslLoadCert, but both changes editlibSceSsl/Export.cppand its CMake/test wiring. #5226 adds connection state and socket calls; this PR replaces the SSL implementation and should preserve those additions when the two are combined. After that rebase, the six focused tests and the title evidence should be rerun on the integrated head.Imported from boykopovar/AnyPS5. Originally posted by eliasbruno124-dev on 2026-10-14T06:12:37Z.
Integrated #5226 first, preserving its authors and connection/socket behavior, then rebased the certificate change onto main
9013e89b1in8bd213cb5.Depends on: #5226is now explicit. The shared registry and a new interaction regression cover certificate loads alongside live connections, separate contexts and termination.The full Windows runtime/relinker build and all seven focused tests pass. With the parent-only SSL implementation, the connection test passes but the certificate regression fails at the original missing operation; restoring the candidate passes again. The final rebase preserves that implementation byte-for-byte. Conventions and diff checks pass; Linux remains untested locally.
The same-input TLOU comparison on
0b6d033b8+ #5226 changes only SSL: baseline aborts atsceSslLoadCert; the integrated candidate returns 0 for the same 1,408-byte CA. With #3925 now in main, HTTP2 send/wait complete with the offline result, then execution stops at a null read at original VA0x1b60f2, before the first frame. The description records the exact tested commit, dependency/size details and preprocessing limits. This proves the certificate fix survives the integration, not gameplay.Prepared with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T09:36:33Z.
@eliasbruno124-dev #5226 goes in first, and this branch carries older copies of its two commits, so I rebased your certificate commit onto #5226's final version: oneandonlydean/AnyPS5@b737308 (branch
ssl3897-on5226). Connect, read and write stayNotImplemented_nid_no_patchstubs and your registry is kept;guest_sslandguest_ssl_loadpass on Linux. Your branch doesn't allow maintainer edits, so could you reset it to that commit? It merges once #5226 is in and the full build is green.Imported from boykopovar/AnyPS5. Originally posted by eliasbruno124-dev on 2026-10-14T10:21:53Z.
Adopted your exact
b737308eedd87e601905fe923b52698a49520557on this branch. #5226 is now merged; connect/read/write keep its explicitNotImplemented_nid_no_patchstubs, and the certificate registry and lifetime regression are unchanged.The complete Windows runtime, relinker and relevant test executables build. All seven focused SSL/HTTP/Net tests pass with the 30-second limit; conventions and diff checks pass. Linux was not run locally. The description keeps the earlier TLOU comparison tied to its measured commit rather than claiming a new title run.
Prepared with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T10:26:14Z.
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).gitmodulesL39docs/dev/debt/libSceNet.mdL5-6