Repository navigation
feat(ssl): run TLS 1.2 client connections over Mbed TLS - #1
Merged
Merged
Conversation
sceSslConnect performs the client handshake on the host socket that the guest number maps to in the libkernel or libSceNet socket table, and sceSslRead and sceSslWrite carry application data. Session state comes from the context's memory pool, and the server is verified against the CAs loaded with sceSslLoadCert; a loaded client certificate is sent when the server asks for one. libkernel exports KernelLookupSocketNative_nid_no_patch, which checks its own socket table before the one libSceNet registers. Pools take a lock so connections can allocate outside the library lock. TLS 1.3 is compiled out. A missing CA, a verify callback, would-block sockets and every failure whose console code is unknown throw, as recorded in the libSceSsl debt entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RoU3ZF76A6uR8sCA7NMLch
loyalburrito
pushed a commit
that referenced
this pull request
Oct 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RoU3ZF76A6uR8sCA7NMLch
11 tasks done
oneandonlydean
pushed a commit
that referenced
this pull request
Oct 18, 2026
…stages Since boykopovar#3878 every vertex program that exports a position also writes gl_ClipDistance for the all-zero position distance. The tessellation stages generated for rect lists declared only gl_Position in gl_in, so their input interface no longer matched the vertex outputs; on MoltenVK the control stage then reads all-zero positions and every rect-list draw stops with "rect-list requires finite nondegenerate axis-aligned positions" (reported in #1). The control and evaluation stages now declare the vertex program's gl_ClipDistance array in their per-vertex blocks and forward it. The generated fourth corner gets the clip distances interpolated with the same weights as its position, so the all-zero position clip keeps working for rect lists. Validation accepts gl_ClipDistance as a tessellation input and as a tessellation-control output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QXdkh9PHBCPqGcGQPeikAe
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
sceSslConnect,sceSslReadandsceSslWriteno longer throwNotImplemented: they run a TLS 1.2 client over the Mbed TLS 3.6.7 submodule.KernelLookupSocketNative_nid_no_patch. It checks libkernel's socket table, then the one libSceNet registers, so bothsocket()andsceNetSocketnumbers work.sceSslDeleteConnection. Each pool now has its own lock, so a handshake or read does not hold the library lock. A connection keeps its pool alive aftersceSslTerm.sceSslLoadCert(chain, validity dates, host name, also sent as SNI). A loaded client certificate is sent when the server asks for one.MbedConfig.hppturns offMBEDTLS_SSL_PROTO_TLS1_3, and libSceSsl now links thembedtlsSSL library. SharpProspero'sSceSslVersionstops at TLS 1.2, and Mbed TLS's TLS 1.3 needs process-wide PSA state that can't come from a context's pool.docs/dev/debt/libSceSsl.mdrecords everything that throws or isn't verified on a console.Questions for maintainers
Anything the sources don't settle throws for now:
sceSslConnectthrows, because no root bundle is shipped. Should a host bundle be trusted? feat(libkernel): serve the sandbox CA bundle from host TLS roots boykopovar/AnyPS5#5280 serves the host's CA bundle to the sandbox, which could fill this.sceSslConnectthrow. SharpProspero gives the arguments (an id, failure bits, the chain, its length, the user argument; a negative return fails the handshake), but not whether the id is the context or the connection, what the bits mean, what type the chain entries are, or when the callback runs.0x8095F006,0x8095F004,0x8095F007and sharpemu's0x8095F008are known.sceSslReadwith flags 0. It returns what one record read delivers, the same asMsgFlagPartialRead(1). SharpProspero leaves open whether flags 0 waits to fill the buffer. Peek (3) throws.Overlap
boykopovar#5911 (verify options, min version, ALPN), boykopovar#5953 and boykopovar#5969 (certificate readers; boykopovar#5969 also changes
sceSslClose's signature) and boykopovar#6511 (certificate reader arguments) editlibSceSsl/Export.cppand its debt entry, but none implements the handshake or I/O. Whichever merges second will need a rebase; I'm happy to do it.Tested
Tested locally by the author on a machine with an NVIDIA GeForce RTX 3080 (12 GB).
Linux (Ubuntu 24.04, GCC 13), full Release build with
BUILD_TESTING=ON, merged with currentmain:guest_ssl_transport_kernelandguest_ssl_transport_netrun an in-process Mbed TLS server on loopback that requires a client certificate, about 0.3 s each:PoolCalloc.guest_sslandguest_ssl_load.-Wall -Wextraunder Ubuntu's MinGW-w64 GCC 13 as a syntax and type check only.agc_driver_graphics,guest_datagram_*×4,guest_named_shm_concurrencyandguest_tcpfail the same way on unmodifiedmainin that container (no IPv6, running as root, "VOP2 opcode is not implemented").guest_kernel_fcntlaborted once under full-suite load. It then passed 30 runs alone and 3 loaded runs of all guest tests.python3 tools/check_conventions.py --base origin/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)🤖 Generated with Claude Code
https://claude.ai/code/session_01RoU3ZF76A6uR8sCA7NMLch