feat(libSceSsl): implement sceSslGetCaList, sceSslFreeCaList and sceSslUnloadCert #2830

Merged
SleglJan merged 1 commit from upstream-pr/2830 into main 2026-10-10 18:12:37 +00:00
SleglJan commented 2026-10-10 16:15:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-10T16:15:11Z.


What

Implements sceSslGetCaList, sceSslFreeCaList and sceSslUnloadCert in libSceSsl.

  • PPSA11386 (007 First Light) imports sceSslGetCaList and sceSslFreeCaList, and PPSA15508 (The Last of Us Part II Remastered) imports sceSslUnloadCert. On main 57f96fd2 all three are missing, and each title's loader stops first on one of them: PPSA11386's with undefined symbol: qOn+wm28wmA (sceSslGetCaList; its other missing imports are sceSslFreeCaList and sceNetShowNetstat, #2831), PPSA15508's with undefined symbol: UQ+3Qu7v3cA (sceSslUnloadCert). For 007 this is row 1 of #2523.
  • No root certificate bundle is shipped and no loaded certificate is kept, so a context holds no certificates. sceSslGetCaList clears the list and returns NOT_FOUND (0x8095F004), as sceSslGetCaCerts already does; sceSslFreeCaList accepts that cleared list and returns 0; sceSslUnloadCert has nothing to drop and returns 0, which is assumed.
  • A null list returns 0x8095177A, the code sceSslGetCaCerts and KytyPS5 return for a null argument; shadPS4 (PS4) returns 0x8095F007 from sceSslGetCaCerts, and its CA-list functions are stubs without parameters. An unknown context and a list sceSslGetCaList did not return throw: KytyPS5 returns SSL_ERROR_INVALID_ID (0x8095F006) for an unknown context in sceSslGetCaCerts, but nothing confirms a code for these functions.
  • Signatures and the 16-byte SceSslCaList (handle array, 32-bit count) follow SharpProspero and shadPS4's OrbisSslCaList; the size is a static_assert.
  • guest_ssl_tests now links libc and calls configure_windows_unwind, as guest_http2_tests does. Without libc, an exception thrown in libSceSsl is raised by the test binary's static libstdc++ __cxa_throw but resumed after the lock_guard cleanup by libc.prx's _Unwind_Resume, which aborts. configure_windows_unwind only acts on MinGW; Windows was last built and tested on the earlier base 8b393b6e (fork run 37987888113: Windows 511/511), not on 57f96fd2.
  • sceSslGetCaCerts and sceSslFreeCaCerts stay as they are (they ignore the context and clear any list), to keep this to one topic.

All of it is recorded in TechnicalDebt, including that on the console the list holds the certificate authorities the SSL service has (shadPS4 #4104 returns a placeholder certificate from sceSslGetCaCerts because Rise of the Tomb Raider fails its initialization checks without one).

Overlap: no open pull request changes libSceSsl. #2742 (Yousef13710) applied this commit and #2753 (pushkarreddyy) declared sceSslUnloadCert as a throwing stub; the intake pause closed both. Closed #1884 implemented the same three functions with Mbed TLS and certificate parsing. sceSslLoadCert throws on main, so no certificate can be loaded.

Tested

  • Linux (CachyOS, kernel 7.2.9, GCC 16.2.1), Ryzen 9 7950X3D, RTX 3080 (NVIDIA 615.71.09), Release with BUILD_TESTING=ON and ANYPS5_ENABLE_SPIRV_TOOLS=ON, this branch on main 57f96fd2: of 701 tests, 696 pass, four video_out_flip_* tests (lifetime, reopen, controls, overlay) skip (no Vulkan in SDL's offscreen video driver), and agc_driver_dcc_keys_first_write fails, which is #2767 (NVIDIA, Linux). guest_ssl passes 3 repeats. tools/check_conventions.py --base upstream/main and git diff --check pass.
  • guest_ssl additions: a null list (also with an unknown context, which pins the check order), the cleared list after NOT_FOUND, three lists sceSslGetCaList did not return ({p, 1}, {nullptr, 1}, {p, 0}), sceSslUnloadCert returning 0 with the list still NOT_FOUND after it, and all three functions throwing after sceSslTerm. Written before the implementation; without it the test does not link. Eight mutations of the implementation each fail it (list not cleared, 0 instead of NOT_FOUND, foreign lists accepted, the count ignored, no context check, sceSslUnloadCert without it, 0 for a null list, the context check before the null check); the mutations were run on the earlier base 8b393b6e, and the rebase changed only line offsets.
  • The patched libSceSsl.prx exports qOn+wm28wmA, +DzXseDVkeI and UQ+3Qu7v3cA.
  • Titles, relinked on main 57f96fd2 and run in a bubblewrap sandbox:
    • PPSA11386 v01.018.000: with this branch and #2831 the loader passes with no absent imports, and the title stops next on sceSharePlayInitialize: invalid argument (row 2 of #2523). On the earlier base 8b393b6e, with the null-heap fix for that stop as well, the title called sceSslGetCaList, sceSslGetCaCerts, sceSslFreeCaList and sceSslFreeCaCerts at start-up and continued.
    • PPSA15508 v02.001.010: the loader stop moves from UQ+3Qu7v3cA to sceVoiceGetMuteFlag, its only remaining absent import. That build also had #2831; PPSA15508 imports none of its functions.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

https://claude.ai/code/session_01Fnrk5Dazjb2tLooVSpdRQq

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4812643381 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2830). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-10T16:15:11Z. --- ### What Implements `sceSslGetCaList`, `sceSslFreeCaList` and `sceSslUnloadCert` in libSceSsl. - PPSA11386 (007 First Light) imports `sceSslGetCaList` and `sceSslFreeCaList`, and PPSA15508 (The Last of Us Part II Remastered) imports `sceSslUnloadCert`. On `main` 57f96fd2 all three are missing, and each title's loader stops first on one of them: PPSA11386's with `undefined symbol: qOn+wm28wmA` (`sceSslGetCaList`; its other missing imports are `sceSslFreeCaList` and `sceNetShowNetstat`, #2831), PPSA15508's with `undefined symbol: UQ+3Qu7v3cA` (`sceSslUnloadCert`). For 007 this is row 1 of #2523. - No root certificate bundle is shipped and no loaded certificate is kept, so a context holds no certificates. `sceSslGetCaList` clears the list and returns `NOT_FOUND` (`0x8095F004`), as `sceSslGetCaCerts` already does; `sceSslFreeCaList` accepts that cleared list and returns 0; `sceSslUnloadCert` has nothing to drop and returns 0, which is assumed. - A null list returns `0x8095177A`, the code `sceSslGetCaCerts` and [KytyPS5](https://github.com/KytyPS5/KytyPS5/blob/59183dbfa81ed7efdff6069177fed50de0552725/src/libs/network.cpp) return for a null argument; shadPS4 (PS4) returns `0x8095F007` from `sceSslGetCaCerts`, and its CA-list functions are stubs without parameters. An unknown context and a list `sceSslGetCaList` did not return throw: KytyPS5 returns `SSL_ERROR_INVALID_ID` (`0x8095F006`) for an unknown context in `sceSslGetCaCerts`, but nothing confirms a code for these functions. - Signatures and the 16-byte `SceSslCaList` (handle array, 32-bit count) follow [SharpProspero](https://github.com/SvenGDK/SharpProspero/blob/5dfdb4b0b166e83dc9ae275001afb695f12c7174/src/SharpProspero/Interop/Net/Http.cs) and shadPS4's `OrbisSslCaList`; the size is a `static_assert`. - `guest_ssl_tests` now links `libc` and calls `configure_windows_unwind`, as `guest_http2_tests` does. Without `libc`, an exception thrown in libSceSsl is raised by the test binary's static libstdc++ `__cxa_throw` but resumed after the `lock_guard` cleanup by libc.prx's `_Unwind_Resume`, which aborts. `configure_windows_unwind` only acts on MinGW; Windows was last built and tested on the earlier base 8b393b6e (fork run [37987888113](https://github.com/SleglJan/AnyPS5/actions/runs/37987888113): Windows 511/511), not on 57f96fd2. - `sceSslGetCaCerts` and `sceSslFreeCaCerts` stay as they are (they ignore the context and clear any list), to keep this to one topic. All of it is recorded in TechnicalDebt, including that on the console the list holds the certificate authorities the SSL service has ([shadPS4 #4104](https://github.com/shadps4-emu/shadPS4/pull/4104) returns a placeholder certificate from `sceSslGetCaCerts` because Rise of the Tomb Raider fails its initialization checks without one). Overlap: no open pull request changes libSceSsl. #2742 (Yousef13710) applied this commit and #2753 (pushkarreddyy) declared `sceSslUnloadCert` as a throwing stub; the intake pause closed both. Closed #1884 implemented the same three functions with Mbed TLS and certificate parsing. `sceSslLoadCert` throws on `main`, so no certificate can be loaded. ### Tested - Linux (CachyOS, kernel 7.2.9, GCC 16.2.1), Ryzen 9 7950X3D, RTX 3080 (NVIDIA 615.71.09), Release with `BUILD_TESTING=ON` and `ANYPS5_ENABLE_SPIRV_TOOLS=ON`, this branch on `main` 57f96fd2: of 701 tests, 696 pass, four `video_out_flip_*` tests (lifetime, reopen, controls, overlay) skip (no Vulkan in SDL's offscreen video driver), and `agc_driver_dcc_keys_first_write` fails, which is #2767 (NVIDIA, Linux). `guest_ssl` passes 3 repeats. `tools/check_conventions.py --base upstream/main` and `git diff --check` pass. - `guest_ssl` additions: a null list (also with an unknown context, which pins the check order), the cleared list after `NOT_FOUND`, three lists `sceSslGetCaList` did not return (`{p, 1}`, `{nullptr, 1}`, `{p, 0}`), `sceSslUnloadCert` returning 0 with the list still `NOT_FOUND` after it, and all three functions throwing after `sceSslTerm`. Written before the implementation; without it the test does not link. Eight mutations of the implementation each fail it (list not cleared, 0 instead of `NOT_FOUND`, foreign lists accepted, the count ignored, no context check, `sceSslUnloadCert` without it, 0 for a null list, the context check before the null check); the mutations were run on the earlier base 8b393b6e, and the rebase changed only line offsets. - The patched `libSceSsl.prx` exports `qOn+wm28wmA`, `+DzXseDVkeI` and `UQ+3Qu7v3cA`. - Titles, relinked on `main` 57f96fd2 and run in a bubblewrap sandbox: - PPSA11386 v01.018.000: with this branch and #2831 the loader passes with no absent imports, and the title stops next on `sceSharePlayInitialize: invalid argument` (row 2 of #2523). On the earlier base 8b393b6e, with the null-heap fix for that stop as well, the title called `sceSslGetCaList`, `sceSslGetCaCerts`, `sceSslFreeCaList` and `sceSslFreeCaCerts` at start-up and continued. - PPSA15508 v02.001.010: the loader stop moves from `UQ+3Qu7v3cA` to `sceVoiceGetMuteFlag`, its only remaining absent import. That build also had #2831; PPSA15508 imports none of its functions. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Fnrk5Dazjb2tLooVSpdRQq
github-actions[bot] commented 2026-10-10 16:15:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T16:15:35Z.


Progress report (57f96fd → 33184a1)

📈 System libraries: 84.53% (+0.01%, +3 implemented functions)

✅ 3 implemented
Library Name
libSceSsl sceSslFreeCaList
libSceSsl sceSslGetCaList
libSceSsl sceSslUnloadCert
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6099575191 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2830#issuecomment-6099575191). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T16:15:35Z. --- <!-- progress-report --> ### Progress report (57f96fd → 33184a1) 📈 **System libraries**: 84.53% (+0.01%, +3 implemented functions) <details> <summary>✅ 3 implemented</summary> | Library | Name | | - | - | | libSceSsl | `sceSslFreeCaList` | | libSceSsl | `sceSslGetCaList` | | libSceSsl | `sceSslUnloadCert` | </details>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!2830
No description provided.