Repository navigation
fix(libSceSsl): return the console's codes for a reset and a non-TLS reply in sceSslConnect - #15848
Merged
oneandonlydean merged 3 commits intoNov 7, 2026
Conversation
…reply in sceSslConnect A PS5 payload measured 0x80410136 when the peer resets during the handshake and 0x80951D78 when it answers in plain text (boykopovar#11922). The host returned SSL_ERROR_SOCKET_CLOSED for the first and threw for the second.
…hut it down mbedtls_net_free shuts the socket down before closing it, which sends a FIN ahead of the RST, so the client saw a clean end instead of a reset. Close it with SO_LINGER 0 here, as Reset() already does (found by the Windows run).
Contributor
Author
|
Windows and WSL2 run at
AI-assisted: yes (Claude Code) |
12 tasks done
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
Open
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
sceSslConnectnow returns the console's codes for two handshake failures that @hugodearaujo's PS5 payload measured in #11922. The payload ran on system software 13.59, against loopback TLS servers it ran itself; the raw lines areSSL|L3-reset-after-hello|sslconnect=80410136andSSL|L4-garbage-after-hello|sslconnect=80951d78.mainSCE_NET_ERROR_ECONNRESET(0x80410136)SSL_ERROR_SOCKET_CLOSED(0x8095170D)the console's error code is unknown)The change, in
Session::CodeforOperation::Connect:MBEDTLS_ERR_NET_CONN_RESETreturnsErrorNetReset, as it already does for reads and closes.MBEDTLS_ERR_SSL_INVALID_RECORDreturns the newErrorNotTls(0x80951D78). mbedTLS returns that error fromssl_parse_record_headerwhen the first byte isn't a TLS record type, as an ASCII reply'sH(0x48) isn't. Seessl_check_record_typeat the pinned068ff080b3,library/ssl_msg.c.MBEDTLS_ERR_SSL_CONN_EOF), which matches the console's third case in fix(libSceHttp2): return the console codes for failed TLS handshakes #11922.libSceHttp2's transport already passes both codes through unchanged (
Transport.cpp:44-45), sosceHttp2SendRequestnow returns them too. #11922's debt entry recorded that these two needed a libSceSsl change first.Debt.
SSL_ERROR_SOCKET_CLOSEDand wasn't measured. It now gives the three measured handshake codes. It also notes that the plain-text reply was the only refused record header measured; any header mbedTLS refuses is taken to answer the same.Test.
GuestSslTransportgains two server modes that read the whole ClientHello record first:SO_LINGER0, so the client gets an RST;HTTP/1.1 400 Bad Request.The client checks only
sceSslConnect's result, since that is all the payload recorded. Onmainthe test fails at the reset row, which returns 0x8095170D there. I leftGuestHttp2Transportalone: itsModeenum is the one line that five open PRs also extend (#11630, #11950, #12305, #15221, #15231).Overlap:
git merge-treemerges this cleanly withmainand with every open pull request that touches these four files and merges withmain. Those are #11630, #11950, #12305, #13468, #15221, #15231 and #15709. #11470, #12456, #12688, #14085, #14212 and #14308 conflict with it, but each already conflicts withmain.Tested
41ddd4d6d7(comment):mainb611e634f7.ctest -R "guest_ssl|http2"passes all 20 tests, and--repeat until-fail:3passes every round.9ab6a281ea. All 21 tests pass, and every repeat round passes.Export.cppfrommain,guest_ssl_transport_kerneland_netfail with "a reset during the handshake did not report the libSceNet reset code".Checked so far, on macOS (arm64, where no full build is possible):
GuestSslTransport.cpppasses an x86-64clang++ -fsyntax-onlyagainst mbedTLS068ff080b3's headers, and so do the changed lines oflibSceSsl/Export.cpp.tools/check_conventions.py --base mainpasses.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)