Skip to content

feat(libSceSsl): add the connection calls - #5226

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
ErenYeager1836:carry/libSceSsl-connection-calls
Oct 14, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
ErenYeager1836:carry/libSceSsl-connection-calls

Conversation

@ErenYeager1836

Copy link
Copy Markdown
Contributor

What

Carried from @screamm with author attribution preserved.

Implements connection lifecycle and parameter exports in libSceSsl:

  • Implements sceSslCreateConnection, sceSslConnect, sceSslRead, sceSslWrite, sceSslDeleteConnection, and sceSslSetVerifyCallback.
  • Manages connection context tracking, socket peer port lookup via sceNetGetpeername, and verification callbacks following SharpProspero Http.cs bindings.
  • Returns SSL_ERROR_INVALID_ID (0x8095F006) for unknown context IDs and throws on null hosts or unimplemented handshake initiation.
  • Updates docs/dev/debt/libSceSsl.md.

Tested

GuestSsl.cpp: exercises connection creation, context validation, callback registration, deletion, and socket lifecycle checks.

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 under Silent stubs in their library's technical debt file
  • 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
  • Unblocks: none
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Progress report (d8888df → 8e68896)

📈 System libraries: 88.28% (+0.08%, +3 implemented functions)

✅ 3 implemented
Library Name
libSceSsl sceSslCreateConnection
libSceSsl sceSslDeleteConnection
libSceSsl sceSslSetVerifyCallback

screamm and others added 2 commits October 13, 2026 17:15
Implements connection lifecycle and parameter exports in libSceSsl:
sceSslCreateConnection, sceSslConnect, sceSslRead, sceSslWrite,
sceSslDeleteConnection, and sceSslSetVerifyCallback.

The repository has no TLS client, so a connection records its context,
socket, host and verification callback:
- sceSslCreateConnection returns a new connection id, or
  SSL_ERROR_INVALID_ID (0x8095F006) for an unknown context. A null host throws.
- sceSslDeleteConnection drops the connection and leaves socket open.
- sceSslSetVerifyCallback stores the callback and argument.
- sceSslConnect, sceSslRead and sceSslWrite throw where handshake starts,
  naming the host and the socket peer port.

Carried from @screamm with author attribution preserved.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@adriadam10

Copy link
Copy Markdown
Collaborator

Thanks for carrying this. On top of current main it did not build: the old parameterless (void) stubs of sceSslCreateConnection, sceSslDeleteConnection, sceSslSetVerifyCallback, sceSslConnect, sceSslRead and sceSslWrite were still in Export.cpp (conflicting C declarations), and GuestSsl.cpp still called sceSslSetVerifyCallback() with no arguments.

I added one commit on your branch removing those stubs and the old test line. The scoped build and tests (27, including guest_ssl) pass. Merging once the Windows build is green.

@adriadam10
adriadam10 force-pushed the carry/libSceSsl-connection-calls branch from 3e134c1 to 793bd22 Compare October 13, 2026 15:20
danielradosa added a commit to danielradosa/AnyPS5 that referenced this pull request Oct 13, 2026
Brings in the connection calls of PR boykopovar#5226 (sceSslCreateConnection,
sceSslDeleteConnection, sceSslSetVerifyCallback, sceSslConnect, sceSslRead and
sceSslWrite), limited to core/libs and its tests. The PR targets main's
context-pool model, so its connections were ported onto this branch's
mbedtls-backed contexts: they live in the library runtime under its mutex,
take ids from the same handle counter as contexts, and libSceSsl links
libSceNet for the peer lookup in the no-transport errors.
danielradosa added a commit to danielradosa/AnyPS5 that referenced this pull request Oct 13, 2026
On top of the connections of PR boykopovar#5226, sceSslEnableVerifyOption and
sceSslDisableVerifyOption record the verification bits a title turns on and
off, sceSslSetMinSslVersion stores a version up to TLS 1.2 and sceSslSetAlpn a
well-formed wire-form protocol list, both returning INVALID_VALUE otherwise.
sceSslGetAlpnSelected reports that nothing was negotiated and sceSslClose marks
the connection closed. The recorded settings and the closed state appear in
the errors the transport calls throw.
@oneandonlydean oneandonlydean self-assigned this Oct 14, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

sceSslConnect, sceSslRead and sceSslWrite still can't do anything here, but they now throw their own runtime_error instead of NotImplemented_nid_no_patch(__func__), so the progress report counts them as implemented. Please keep those three as NotImplemented_nid_no_patch(__func__) stubs until there is a transport. Which title calls the connection functions?

@ErenYeager1836

Copy link
Copy Markdown
Contributor Author

Updated as requested! Kept sceSslConnect, sceSslRead, and sceSslWrite as NotImplemented_nid_no_patch(func) stubs so they remain counted as todo/unimplemented in progress reports until TLS transport is implemented, and cleaned up the unused transport exception helpers and tests.

Regarding which title calls the connection functions:

  • They were originally introduced as parameterless stubs for PPSA07411 (Resident Evil 4) in commit �03afed4c ( ix(exports): export the calls PPSA07411 imports), as RE4 failed to load without them.
  • They are also imported by titles using fmpeg.prx (e.g., media playback/streaming).

@oneandonlydean
oneandonlydean merged commit 5642906 into boykopovar:main Oct 14, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants