feat(http2): deliver TLS certificate verification callbacks #11586
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11586"
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 JJenkx on 2026-10-26T21:37:57Z.
What
sceHttp2SetSslCallbackcurrently throws when a title registers a callback. Preserve the callback/user argument in inherited template/request settings and install an adapter on the actual libSceSsl connection. Deliver the SSL context ID, verification flags and usable peer-certificate handles; zero accepts and nonzero refuses the chain. Clearing the callback preserves ordinary certificate verification.Reuse #11575's request-callout bookkeeping so a callback can inspect certificates, abort or delete its request without deadlocking. The adapter is detached after the handshake and request cleanup clears its lock reference. Redirected requests verify each new TLS connection. Unknown HTTP2 refusal/error mappings remain explicit failures, documented in debt.
The redirect prerequisite #11575 is now merged into main. The latest review correction removes only the test requiring SSL callback registration on context/cookie-box IDs to throw through an unimplemented path. Implemented registration, clearing, override, invalid-ID and live TLS callback coverage remains.
Tested
Independent re-check by XairRrR: exact documentation-follow-up head
e5408c7638f9merged onto main5cb015caaaaf, Debian13/GCC14.2 Release; all9guest_http2*groups plusguest_memory_pool_statsandpublic_headerspass11/11. Production code and tests remain unchanged from173968c4710.Documentation-only review follow-up
e5408c7638frestores the final newline and blank line before the next debt heading. No production/test source changes; prior runtime evidence remains pinned to its tested commits. Conventions against main5cb015caaaaand whitespace checks pass.Exact head
173968c47107bd7bf0182ab4c574b0aae9761b8b, incorporating mainb28bb772177768f99874ca38f6252cd0139acf2a. Linux 7.2.11, Ryzen 9 7950X, GCC 16.2.1, Release, independently rebuilt production libSceHttp2 and selected tests.guest_http2*groups plusguest_memory_pool_stats, each repeated three times: 30 passes, zero skips. Includes real loopback TLS certificate verification callbacks, redirects, HTTP/2 transport, early response, roots, options/cookies and teardown.public_headers,check_conventions.py --base b28bb772177768f99874ca38f6252cd0139acf2aand whitespace checks pass.Review correction, exact pins, build and repeated-test logs/JUnit, SHA-256
dbbf8a55716a466cf29c06e0458d542f67549ac20104cdef7b1d910e5ba72433.Earlier TLS callback qualification and prior Windows integrated-child evidence retain their original pins. FAR PPSA03766 reaches the underwater tutorial with this and #11611; that current-main-plus-prerequisites evidence uses historical head
394efb4c75, not this new test-only head. No new native title, console, GPU or performance claim.Independent AMD recheck of current head
e5408c7638: TechLevelZero report, merged ontoa4eca2a, RX6300/RADV Mesa25.2.8 on Ubuntu. Reported950 passes,4 failures (zero new:3 also fail on main and1 unstable on main),3 skips, and no new validation IDs across453 GPU tests. This is attributed third-party evidence; the full suite was not all-green. The focused current-head HTTP2 and headers recheck above remains11/11 pass.Independent Windows title screening reported by xXPBSXx: PPSA06465 on main
7feb37ee3eaborted after 22 seconds withsceHttp2SetSslCallback not implemented; this heade5408c7638locally merged onto the same main ran for 580 seconds until the script stopped it, without that message or a recorded fatal error. Windows 10, RTX 4080 SUPER, one completed run per arm. Graphics were not reviewed and callback-path execution was not verified. This is attributed third-party startup screening; the live TLS callback tests above provide the callback behaviour evidence.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T22:12:12Z.
Review: APPROVED
Reviewed the feature delta against #11575: callback settings are snapshotted into the request, the adapter forwards the SSL context, verification flags, certificate handles and user argument, maps zero/nonzero to accept/refuse, and is detached after the TLS handshake.
InvokeCallbackreleases the request lock for the user callback and restores it on both return and exception; the added cases exercise real certificate inspection, untrusted/host-name flags, refusal, clearing, snapshot/override, abort/delete, exceptions and redirected TLS hops. The PR correctly declares its dependency and documents unverified console scheduling/error mappings. The author reports all six Linux HTTP2 groups passing and a native title run reaching the separate HTTP/1.x transport gap; Windows is untested. Hosted policy checks pass, while product builds are skipped by path policy. I did not run the full transport suite locally.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T23:10:17Z.
Review: APPROVED
Reviewed — approved
sceHttp2SetSslCallbacknow saves the callback in the template and request settings and installs it on the libSceSsl connection for each TLS handshake. The checks, the HTTP2 tests and two negative controls all came out as expected, and I found nothing blocking.What I ran
Head
173968c47107bd7bf0182ab4c574b0aae9761b8b, merged with--no-ffintomain5cb015caaaaf83f8ee431414ee6a457b5b307d49(merged tree165b2a148ec08a4fceb83e770550ec1c3f39275a). Debian 13 VM, Xeon Gold 6136, GCC 14.2.0, Release, Ninja,BUILD_TESTING=ON.Results
git diff --checkcheck_conventions.pylibsguest_http2*tests,guest_memory_pool_stats,public_headers, 3 runs eachguest_http2_ssl_callbackstakes about 2.3 s; the slowest HTTP2 test isguest_http2_redirectsat about 13.3 s.agc_driver_image_sample_lod_clamp_shader_laneunwrap_self_..._destination_directory_groupguest_http2tests after restoring the merged treeThe build script listed two new failures. Neither comes from this PR:
libSceHttp2(lddshows no HTTP library), and the PR touches nothing under the AGC driver or the shader recompiler.unwrap_selfis a Python tool test that fails atos.chown(...)withEINVALin the sandbox's/tmp. The PR changes no file undertools/.The failure baseline was measured on an older
main(096c45570f). I attribute both failures tomainor to this environment.Failure excerpts
Negative control
main. I restoredExport.cpp,Transport.cpp,Transport.hppandinclude/Http2.hppfrommain. The test sources then fail to compile, becausemain'svoid* cbFuncparameter does not accept the typed callback (invalid conversion from 'int (*)(int, unsigned int, void* const*, int, void*)' to 'void*').main. With the merged files, I put back onlymain's throwing body ofsceHttp2SetSslCallback(theNotImplemented_nid_no_patchcall).guest_http2andguest_http2_ssl_callbacksabort, andguest_http2_redirectsstill passes. This is consistent with BunnyFl's earlier Windows control.sceSslSetVerifyCallback(ssl, Verify_nid_no_patch, this)installation atTransport.cpp:509.guest_http2_ssl_callbacksfails, so the test checks that the callback is actually delivered, not only that registering it is accepted.After the controls I restored the merged files, rebuilt, and the
guest_http2*tests passed again.git status --porcelainis empty.Findings
Blocking
None.
Non-blocking
docs/dev/debt/libSceHttp2.md. The PR's only change to the last line of the file (L52) removes the final newline;mainends the file with\n. It does no harm, but it adds an unrelated diff line and will annoy the next editor. Suggested fix: restore the trailing newline.### Additional PS5 3.20 imports. Suggested fix: add a blank line between them, as the other sections do.Code notes (no action needed)
RunCallbackrefuses only when the callback returns a negative value (libSceSsl/Export.cpp L925-L933). The adapter turns any nonzero result into-1(Transport.cpp L376-L384), so the "nonzero refuses" rule in the debt entry holds; test mode 3 returns7and covers it.*state.callbackLockbeforeInvokeCallbackreleases the request mutex. WhensceHttp2DeleteRequest→Stop()→Close()clearscallbackLockand deletes the SSL connection during the callback, the frame still holds a valid lock reference.Sessionalive through ashared_ptrinEstablish, andCheck()then throws "cancelled".RunCallback, leavingsession.verifyingset, butFail()deletes that connection, so the flag is never read again. Modes 6, 7 and 8 exercise these paths, and they pass.Update()path inExport.cppstill throws.Not verified
Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T23:44:51Z.
Review: APPROVED
Re-checked — approved
The only new commit,
e5408c7638, fixes both debt-doc whitespace nits from my last review. Nothing else in the PR changed, and the checks and HTTP2 tests still pass.What changed since my last review
e5408c7638("docs(http2): separate SSL callback debt sections"). It changes onlydocs/dev/debt/libSceHttp2.md, adding 2 lines and removing 1.173968c471, which I reviewed last time.What I ran
Head
e5408c7638f9f68f2e86dee1a8bdf55517b26bd2, merged with--no-ffintomain5cb015caaaaf83f8ee431414ee6a457b5b307d49(merged tree399e914006c1fcc62092ded1e8d26af9b750205d). Debian 13 VM, Xeon Gold 6136, GCC 14.2.0, Release, Ninja,BUILD_TESTING=ON.173968c471docs/dev/debt/libSceHttp2.mdchangedgit diff --checkcheck_conventions.pylibsguest_http2*tests,guest_memory_pool_stats,public_headersguest_http2_ssl_callbacks2.4 s,guest_http2_redirects13.6 s)agc_driver_image_sample_lod_clamp_shader_lane,unwrap_self_..._destination_directory_group)tools/files changed.Negative control: I did not repeat it. No test or production file changed since
173968c471, so the controls from my previous review still apply.Previous findings
docs/dev/debt/libSceHttp2.md. The file now ends with\n, and the merged diff againstmainno longer touches the last line.### Additional PS5 3.20 imports. There is now a blank line between the SSL callbacks entry and that heading (L49-L51).New findings
Blocking
None.
Non-blocking
None.
Not verified
173968c471and earlier heads. Since then only the doc changed.