feat(http): implement sceHttpCreateRequest2, sceHttpsEnableOption, sceHttpsLoadCert and sceHttpGetLastErrno #555

Merged
Phi1ow merged 1 commit from upstream-pr/555 into main 2026-10-04 21:36:50 +00:00
Phi1ow commented 2026-10-04 20:05:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Phi1ow on 2026-10-04T20:05:18Z.


What

Four more libSceHttp exports, following the library's existing "no network emulated" model
(created objects get handles; anything that would touch the network fails with the network
error):

  • sceHttpCreateRequest2(connId, method, path, contentLength) — returns a new handle, like
    the existing sceHttpCreateRequestWithURL2.
  • sceHttpsEnableOption(id, flags) — returns 0, the counterpart of the existing
    sceHttpsDisableOption.
  • sceHttpsLoadCert(httpCtxId, num, caList, cert, key) — returns 0; certificates are
    accepted and ignored, as no TLS handshake is performed.
  • sceHttpGetLastErrno(reqId, errNum) — no request reaches the network and no per-request
    errno is tracked, so it reports 0; a null output pointer returns ERROR_INVALID_VALUE,
    like the other getters in this file (sceHttpCreateEpoll).

Signatures follow the public OpenOrbis SDK headers (include/orbis/Http.h).

Tested

core/libs/tests/GuestHttp.cpp (the existing guest_http test) is extended with assertions
for the four functions: a request handle is positive, the two no-ops return 0,
sceHttpGetLastErrno writes 0 and rejects a null pointer. The new assertions fail without
the change (the four symbols are undefined) and pass with it.

Built with MinGW-w64 GCC 15.2.0 (the CI toolchain) on Windows 11; ctest -R guest_http passes. Without the four implementations the test does not link (the symbols are undefined).

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4737224569 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/555). Originally posted by [Phi1ow](https://github.com/Phi1ow) on 2026-10-04T20:05:18Z. --- ### What Four more `libSceHttp` exports, following the library's existing "no network emulated" model (created objects get handles; anything that would touch the network fails with the network error): - `sceHttpCreateRequest2(connId, method, path, contentLength)` — returns a new handle, like the existing `sceHttpCreateRequestWithURL2`. - `sceHttpsEnableOption(id, flags)` — returns `0`, the counterpart of the existing `sceHttpsDisableOption`. - `sceHttpsLoadCert(httpCtxId, num, caList, cert, key)` — returns `0`; certificates are accepted and ignored, as no TLS handshake is performed. - `sceHttpGetLastErrno(reqId, errNum)` — no request reaches the network and no per-request errno is tracked, so it reports `0`; a null output pointer returns `ERROR_INVALID_VALUE`, like the other getters in this file (`sceHttpCreateEpoll`). Signatures follow the public OpenOrbis SDK headers (`include/orbis/Http.h`). ### Tested `core/libs/tests/GuestHttp.cpp` (the existing `guest_http` test) is extended with assertions for the four functions: a request handle is positive, the two no-ops return `0`, `sceHttpGetLastErrno` writes `0` and rejects a null pointer. The new assertions fail without the change (the four symbols are undefined) and pass with it. Built with MinGW-w64 GCC 15.2.0 (the CI toolchain) on Windows 11; `ctest -R guest_http` passes. Without the four implementations the test does not link (the symbols are undefined). ### 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
oneandonlydean commented 2026-10-04 21:19:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T21:19:40Z.


Thanks. All four names match their NIDs, and they fit the library's no-network model on main: sceHttpCreateRequest2 hands out a handle like sceHttpCreateRequestWithURL2, sceHttpsEnableOption mirrors sceHttpsDisableOption, and ignoring the certificates is fine because no request ever connects (sceHttpSendRequest returns ERROR_NETWORK).

For the maintainer: #407 (and #545, which builds on it) exports the same two NIDs as throwing stubs, sceHttpUnknown02 (0onIrKx9NIE, which is sceHttpGetLastErrno) and sceHttpUnknown04 (rGNm+FjIXKk, which is sceHttpCreateRequest2). The two PRs also conflict in libSceHttp/Export.cpp. Since this PR has the real names, those two stubs should be dropped from #407 when one of them is rebased. Nothing to change here for that.

Ready to merge from my side once CI has run (it still needs approval).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5984497868 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/555#issuecomment-5984497868). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T21:19:40Z. --- Thanks. All four names match their NIDs, and they fit the library's no-network model on main: `sceHttpCreateRequest2` hands out a handle like `sceHttpCreateRequestWithURL2`, `sceHttpsEnableOption` mirrors `sceHttpsDisableOption`, and ignoring the certificates is fine because no request ever connects (`sceHttpSendRequest` returns `ERROR_NETWORK`). For the maintainer: #407 (and #545, which builds on it) exports the same two NIDs as throwing stubs, `sceHttpUnknown02` (0onIrKx9NIE, which is `sceHttpGetLastErrno`) and `sceHttpUnknown04` (rGNm+FjIXKk, which is `sceHttpCreateRequest2`). The two PRs also conflict in libSceHttp/Export.cpp. Since this PR has the real names, those two stubs should be dropped from #407 when one of them is rebased. Nothing to change here for that. Ready to merge from my side once CI has run (it still needs approval).
github-actions[bot] commented 2026-10-04 21:20:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-04T21:20:47Z.


Progress report (d7f0c49 → be59a9e)

📈 System libraries: 77.38% (+0.03%, +4 implemented functions)

✅ 4 implemented
Library Name
libSceHttp sceHttpCreateRequest2
libSceHttp sceHttpGetLastErrno
libSceHttp sceHttpsEnableOption
libSceHttp sceHttpsLoadCert
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5984507571 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/555#issuecomment-5984507571). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-04T21:20:47Z. --- <!-- progress-report --> ### Progress report (d7f0c49 → be59a9e) 📈 **System libraries**: 77.38% (+0.03%, +4 implemented functions) <details> <summary>✅ 4 implemented</summary> | Library | Name | | - | - | | libSceHttp | `sceHttpCreateRequest2` | | libSceHttp | `sceHttpGetLastErrno` | | libSceHttp | `sceHttpsEnableOption` | | libSceHttp | `sceHttpsLoadCert` | </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!555
No description provided.