Files
Petre 7c26b9e86b fix(libSceHttp2): return the console's codes for HTTP/2 stream errors, TLS deadlines and deleted requests (#18824)
* fix(libSceHttp2): return the console's codes for HTTP/2 stream errors, TLS deadlines and deleted requests
* docs(libSceHttp2): cite #18824 in the measured-failures entry
* test(libSceHttp2): close the HTTP/2 close-test server with a FIN on every host
* docs(libSceHttp2): record the measured resolve expiry on a PS5
* test(libSceHttp2): drain the client before closing after a GOAWAY
* test(libSceHttp2): drain the client before closing after a body reset
* test(libSceHttp2): expect the measured 0x817B1080 for a delete between loads
2026-11-22 05:47:54 +13:00

26 KiB

libSceHttp2 technical debt

  • HTTP transport returns 0x804101e6 after failed DNS lookups and 0x8041013d when a connection is refused. A native PS5 HTTP probe on firmware 13.590.001 confirmed these codes for NXDOMAIN and connection refusal, both as synchronous return values and as asynchronous completion results.

Silent stubs

  • sceHttp2RedirectCacheFlush - returns 0 for any argument without checking it, as the 13.42 module does (#10536); redirects are followed without a cache, so there is nothing to flush

  • libSceHttp2 offline requests - when APS5_NET_DISCONNECTED is set, sceHttp2SendRequest returns network error 0x80431063 without connecting, sceHttp2SendRequestAsync queues the same result and triggers the user event on the caller's equeue, and sceHttp2WaitAsync returns the queued result, unblocking offline mode in PPSA24263 (#11591). 0x80431063 is libSceHttp's network error (HttpErrors.hpp); libSceHttp2 also returns libSceHttp-range codes such as 0x804311FE, but the code a console returns for an offline libSceHttp2 send is not measured. Without that environment variable, async send submissions and wait throw; public sources do not establish live completion event types, timeout updates or cancellation results. PPSA17221 and PPSA15508 establish caller ABI only.

  • libSceHttp2 WebSocket ping settings - sceHttp2WebSocketSetPingInterval and sceHttp2WebSocketSetPingTimeout check their values as a PS5 does and drop them, since a WebSocket request never connects

Unknown function info

  • Additional HTTP2 exports - these name/NID pairs are present in the 13.60 export inventory. Parameter lists, return types and behavior are unverified. Parameterless int declarations are import-resolution placeholders, not verified ABI prototypes; every entry throws through NotImplemented_nid_no_patch. No runtime functionality is implemented.
Name NID
sceHttp2SetProxyWithURL fkKvmzFNBe8
sceHttp2SetRequestServerName zx9s1Lk+O90
sceHttp2SetStripGZIPHeadersEnabled mMWZm0+7XHM
sceHttp2WebSocketClose v2hFBiyS13w
sceHttp2WebSocketSendDataMessage D1IAo-CNswA
sceHttp2WebSocketSendTextMessage jSHMX1oSE+E
sceHttp2WebSocketSetCloseTimeout 4PUc7B6Zr+c
  • sceHttp2DeleteCookieBox (libSceHttp2) - imported by PPSA35943's Unity player. The (int cookieBoxId) signature follows SharpProspero. A box sceHttp2CreateCookieBox returned is discarded; an unknown or already deleted id returns the library's invalid-id error (0x817B1100), as prosper does; not measured on a console

  • libSceHttp2 cookie boxes (libSceHttp2) - sceHttp2CreateCookieBox takes a machine-sized pool size and requires at least 64 KiB. On 13.42 the pool is rounded up to 16 KiB (wrapping to 0 for SIZE_MAX) and mapped with sceKernelMapNamedFlexibleMemory, whose error is returned unchanged; the host maps it the same way under an assumed name, but does not reproduce native cookie-heap bookkeeping, identifier ranges or retained request references. Its delete signature and invalid-ID error are confirmed. sceHttp2SetRequestNoContentLength takes only the request id. sceHttp2CookieFlush empties a cookie box and answers 0 for any other id.

  • sceHttp2SetCookieBox and sceHttp2GetCookieBox (libSceHttp2) - follow an emulator run of the 13.42 module: templates and requests accept a live box or 0 (unbind), other ids and unknown or deleted boxes return 0x817B1100, a new request copies its template's box, a deleted box stays reported by the requests holding it, and sceHttp2GetCookieBox(id, int*) returns 0x817B1225 for a null output before writing 0 and checking the id, then 0x817B1025 when no box is bound.

  • libSceHttp2 cookie transport (libSceHttp2) - network behavior is unmeasured on the console; the 13.42 module run cannot reach the network. Matching box cookies accompany manual cookies as an extra HTTP/2 field or one combined HTTP/1 field following RFC 6265. Response Set-Cookie fields use sceHttp2AddCookie rules, silently dropping rejected cookies. Manual/automatic cookie composition and redirect behavior remain unverified

  • libSceHttp2 cookie store (libSceHttp2) - behavior follows a run of GuestHttp2Cookies.cpp's sequence against 13.42's libSceHttp2.sprx (#10534). Not reproduced: the 0x817B1076 stack check below 0x1FD0 bytes of stack, and the pool size is not enforced. Assumed, not measured on libSceHttp2: the default total limit of 3000 with the 10 oldest dropped past it, and the NUL, space, NUL written after the header (both libSceHttp's), which of no match and null cookie/required is checked first, public-suffix rules for Domain, and dates beyond the tested ones. Equal-length paths come out with the first stored last, a rule inferred from the runs

  • libSceHttp2 pending exports - 4 named callable exports were identified in the PS5 3.20 export table and cross-checked against firmware 13.60. Signatures and behavior remain unverified; declarations use the unknown-signature convention and throw through NotImplemented_nid_no_patch. Evidence: 3.20 export list.

Functional

  • sceHttp2WaitAsync still writes the async result in place, so an unmapped pointer there still crashes the host. It needs a finished request, which the tests cannot produce offline.

  • sceHttp2GetCookie (libSceHttp2) - the required size, the terminator written to a too-small buffer and the header are copied out with GuestCopyOut_nid_no_patch; an unwritable cookie or required returns 0x817B11FE, as null ones do, and errno is preserved. A host-safety fallback: console behaviour on unmapped memory is unmeasured.

  • Default TLS trust (libSceHttp2) - HTTPS connections also trust the system CA list, /<sandbox word>/common/cert/CA_LIST.cer, served by libkernel from the host trust store, after the title's own libSceSsl certificates. RetroArch (PPSA99169, updater), PS5LM (PPSA99575) and Porpoise (PPSA99764) send version-3 requests to public https:// servers with no loaded certificate, verify callback or verification option, which pass the known-CA check only if the console trusts public roots by default. That the console's roots are exactly this file is not measured

  • libSceHttp2 transport - synchronous version 1/2 requests use HTTP/1.0 or HTTP/1.1 over HTTP or HTTPS; version 3 requires ALPN h2 over HTTPS and uses HTTP/1.1 over HTTP. HTTP/1.x supports fixed-length, chunked and close-delimited responses; chunk trailers are validated and discarded. Negotiation fallback, connection reuse, multiplexing across requests, CONNECT, HTTP/2 response trailers and authentication challenges throw. Nonempty HTTP/1.0 uploads without Content-Length also throw. HTTP/1.x framing follows RFC 9112; HTTP/2 follows RFC 9113. Native behavior remains unverified.

  • libSceHttp2 version 3 over HTTP - a version-3 request to an http:// URL is sent as HTTP/1.1, without an Upgrade: h2c header. That a version-3 template reaches HTTP/1.x servers over http:// is inferred from OliSe Player and ps5-payload-sdk's http2_get, which use version 3 for http:// URLs. Not measured: what the console sends (HTTP/1.0 or HTTP/1.1, or an h2c upgrade), and whether such a request stays on HTTP/1.1 when redirected to https://, as it does here. A version-3 HTTPS server that offers no h2 and a version-3 HTTPS redirect to http:// throw

  • libSceHttp2 transport ABI - version values, string methods, header overwrite/append modes, status/read/content-length signatures and timeout units follow SharpProspero. prosper records the method argument as an integer instead. These are public compatibility contracts, not console measurements.

  • libSceHttp2 error paths - these throw, as their console codes are not implemented: lookup failures, the unmeasured deadlines below, other sceSslConnect results, protocol failures, malformed inputs, concurrent calls on one request and exhausted connection slots. The seven handshake failures a PS5 payload measured against loopback TLS servers pass through unchanged: 0x8095F00B, 0x8095F00C, 0x8095F00D, 0x8095F010, 0x8095170D for a peer that closes, 0x80410136 for one that resets and 0x80951D78 for a reply that is not TLS; #11922 lists each case. After a failed send sceHttp2GetStatusCode returns 0 and stores 0, the content length and read calls return 0x817B1065, and another send returns the same error.

  • libSceHttp2 measured failures - a PS5 payload on firmware 13.590.001 (#17735 and #18824 list each case) measured, over http://, HTTPS/1.1 and HTTP/2: abort 0x817B1080, also before a send; deleting the request or its template during an operation 0x817B1080; a peer closing or, over TLS, resetting before the response headers 0x817B1064; over http:// a reset 0x80410136. HTTP/1.x: a body shorter than its Content-Length reads as ended, a chunked body the peer cuts off 0x817B1064, failed reads repeat, a send after a complete response 0x817B1066. Still unmeasured and throwing: sceHttp2Term during an operation, a TLS reset after the headers, an invalid chunk size and a cut chunk terminator or trailer.

  • libSceHttp2 connections - socket connect errors propagate the libSceNet result, following the module-analysis report in prosper #2894; the report does not establish every exported error path. A request uses one connection; a context's concurrency cap counts connections until EOF, failure or deletion. Native pooling, scheduling, validation order and teardown semantics remain unverified. DNS uses two host workers and a queue of eight; cancellation/deadlines abandon the caller's wait, not libc's lookup. Library unload can wait for a host lookup to return. A resolve retry resubmits a failed lookup with a new timeout; a timed-out lookup isn't retried. The console's retry semantics are unverified.

  • libSceHttp2 request deadlines - the host checks the overall deadline before buffered as well as socket reads; reading a response buffered before expiry after it is unmeasured. Overall expiry returns 0x817B1068, receive 0x817B1222, send 0x817B1223 (TLS included), cleartext connect 0x817B1221. As on a PS5 (firmware 13.590.001), the receive timeout bounds a TLS handshake (0x817B1222 1.2 s into a stall with 1 s set) and the connect and send timeouts do not (1 s let it run past 40 s); an HTTP/2 upload ends at whichever of the send and receive timeouts comes first, while a 1 s receive timeout did not end a stalled HTTPS/1.1 upload within 20 s. Resolve expiry throws: on the PS5 an unanswered lookup failed with 0x804101E2 after 30 s (queries at 0, 2, 6, 14 s) with the default or a 1 s timeout, also with retry 0; with 5 s, queries at 0, 5, 15, 35, 75 s and no result in 90 s. Validation order is unverified.

  • libSceHttp2 HTTP/2 stream errors - as on a PS5 payload (firmware 13.590.001): a GOAWAY before the response headers fails the send with 0x817B120A plus its error code (0 to 13 with last stream 0, and NO_ERROR with the request's stream as last), an RST_STREAM before them with 0x817B122A plus its code (0 to 13). After the headers, an RST_STREAM CANCEL fails the next read with 0x817B1232 and a closed connection with 0x80410136. Other codes, other RST_STREAM codes after the headers and a GOAWAY after them throw. The console's first 64-byte read failed although 5 body bytes had arrived; here a closed connection and a cut chunked body return those bytes first. The probe's servers closed with a TCP FIN and no TLS close_notify.

  • libSceHttp2 TLS settings - minimum SSL versions outside 2 to 5 and flags outside 0x3d throw. SSL callbacks use the verification adapter described below. Supported certificate-check bits follow SharpProspero and use libSceSsl's TLS 1.2 backend and CA context; native defaults and error translation are unverified. Settings on object kinds other than templates/requests throw, except for the request options below and context SSL flags; other native restrictions are unverified. Settings become immutable when transport is created. Zero timeout values and negative resolve retries throw; a failed lookup is retried up to the set count. Host HTTP allocations are not charged to the context pool, so sceHttp2GetMemoryPoolStats reports a live context's pool size with zero peak and current use. PPSA01494, PPSA30839 and PPSA31162 read them for logging without checking the result and stopped at startup while it threw.

  • sceHttp2SetConnectionWaitTimeOut (libSceHttp2) - stores a connection wait timeout in microseconds on a template or request and returns 0x817B1100 for an unknown id, as KytyPS5 does. It follows the other timeout setters where they differ from KytyPS5: a context or cookie box throws where KytyPS5 returns 0x817B1100, and 0 throws where KytyPS5 stores it, since the console is not measured for either. The default is not measured and the host never consumes the value: a request whose context has no free connection slot throws instead of waiting (see the error paths entry), so a console's timeout result for an exhausted pool is unknown

  • sceHttp2SetMinSslVersion - libSceHttp2's own range and validation order are not measured: versions 2 (SSL 3.0) to 5 (TLS 1.2) are accepted, the range sceSslSetMinSslVersion takes on a 13.40 console (libSceSsl). The floor is not kept: libSceSsl negotiates TLS 1.2 only, which meets every accepted floor, so a server limited to versions older than TLS 1.2 fails the handshake whatever the floor; what a lower floor does with such a server on a console is not measured.

  • sceHttp2SslEnableOption, sceHttp2SslDisableOption (libSceHttp2) - accept a context id as well as a template or request, as prosper does for any live object; PPSA06866 sets them on its context (#13715). The context keeps the flags and templates created after the call copy them; that inheritance, and whether templates already created see the change, are not established by any source or measured on a console

  • libSceHttp2 request options - extends the TLS settings entry: the auth and redirect flags, headers and the auth-info and pre-send callbacks live in Http2::Settings, are copied into each new request and become immutable once transport exists; the getters still read them then. Accepted kinds, defaults, copying, header modes, error codes and their order follow the 13.42 module run in an emulator (#10536), not a console. A null out-pointer to sceHttp2GetAuthEnabled is written through on that module; here it throws. The pre-send callback type is unknown. The transport never calls either callback, and the auth cache flush only validates the context

  • sceHttp2GetAllResponseHeaders (libSceHttp2) - HTTP/1.x returns the final raw header block, excluding the terminating NUL, owned until request deletion; its native size/lifetime contract remains unverified. HTTP/2 serializes a decoded header block as HTTP/2.0 <code> HTTP2 NO PHRASE\r\n, then one <name>: <value>\r\n line per header with the lowercase name nghttp2 reports, a consumed :status pseudo-header and a final \r\n; the format comes from the firmware 11.00 libSceHttp2.prx (sceHttp2GetAllResponseHeaders at 0x15e0, helper at 0x5210 and its serializer), so the reason phrase is the console's literal and not a local table. Status and Content-Length fields are decoded; chunked HTTP/1.x reports kind 2, absent Content-Length kind 1, following SharpProspero. The buffer lives until the request is deleted.

  • libSceHttp2 gzip responses - console buffering, inflated-length reporting, header rewriting and error mappings are unverified. Enabled gzip responses wait for END_STREAM and use 64 MiB encoded/decoded host limits. Serialized headers remain as received; the guest supplies Accept-Encoding. Other content encodings are not inflated.

  • sceHttp2GetAllTrailingHeaders serializes the trailer block as one <name>: <value>\r\n line per trailer field and a final \r\n, with no status line, and keeps it until the request is deleted. Firmware 11.00's libSceHttp2.prx returns a cached block (sceHttp2GetAllTrailingHeaders at 0x16b0, helper at 0x5340), but the console's exact trailer serialization was not measured, so this follows the response-header serializer without the status line. A request with no trailers throws; the console error for that case is unknown.

  • libSceHttp2 asynchronous requests - sceHttp2ReadDataAsync returns 0x80436063 unconditionally, matching the bundled module's mov eax; ret body, so no read result is produced. sceHttp2WaitAsync validates a non-null result, a null option and a live request, then drains a queued 24-byte Http2AsyncResult; the module aborts on an empty queue and never reads timeout. Here the empty-queue case throws because the producer sceHttp2SendRequestAsync is unimplemented and no completion is manufactured; completion event types, cancellation results and async-buffer ownership are unverified.

  • Host request header (libSceHttp2) - a Host header set with sceHttp2AddRequestHeader becomes the request's :authority pseudo-header and is not sent as a Host field, following the HTTP/1.1-to-HTTP/2 translation in RFC 9113 section 8.3.1. The last value set wins. The console's handling of a Host that differs from the URL authority and of whitespace in the value is not measured; here whitespace throws.

  • libSceHttp2 WebSocket requests (libSceHttp2) never connect, so text and data sends and sceHttp2WebSocketCloseAsync return 0x817B1065, as a PS5 (firmware 13.40, measured inside PPSA01317) does before the handshake. Connecting one throws with the other asynchronous sends; on the PS5 a failed handshake (0x8041013D for a refused connection, 0x804101E6 for an unresolvable host) completes the request and also calls its error callback with the request id from the library's own thread. On that PS5 a null text or data returns 0x817B11FE before the request id is looked up, also for a WebSocket request that has not connected. Read from the module (libSceHttp2.sprx, firmware 13.40) and not measured on a console: the template is checked before the URL, a ping value before the request id, a send's flags, data size and async option are not checked before the connection check, and the scheme comparison ignores case

  • WebSocket ping settings: both setters take a 32-bit request ID and a 32-bit interval/timeout in microseconds, confirmed by the timer consumer and its clock conversion.

  • sceHttp2Init - a negative maximum concurrent request count throws, and the pool size is not checked. In a payload process on a PS5 (firmware 12.70), with a 64 KiB pool, a count of 0 returned 0x817B11FE (invalid value) and a count of 1 returned 0x817B121D (pool too small). A count of -1 with that pool, and a count of 1 with a 1 MiB pool in a second run, produced no result before the runner's timeout, so their return values and the smallest accepted pool are not measured. Every call with a constant count in the titles checked passes 1 to 32, and every call with a constant pool size passes 256 KiB to 2.75 MiB, the range above the measured 64 KiB pool; the value of the other calls is not known.

  • libSceHttp2 automatic proxy configuration - flags 0 and 1 both use direct connections, matching libSceNetCtl, which reports proxy configuration off, an empty server and port zero. Other flag values throw. This is the host configuration policy, not a console measurement of proxy discovery; PAC/WPAD and configured proxies remain unsupported. The boolean argument and acceptance of 1 by callers are evidenced by OliSe Player and RetroArch; call sites do not establish library behavior.

  • libSceHttp2 redirects - native caching, callback scheduling, target-reference delivery and method/body rewriting remain unverified. The typed callback, zero-follow/nonzero-refuse behavior and six-redirect cap follow SharpProspero, not console measurements. Refusal exposes the received status/body. Method selection follows RFC 9110 section 15.4; URI reference resolution follows RFC 3986 section 5.2. HTTP/2 downgrade to HTTP, duplicate Location fields, invalid callback methods, redirect-limit exhaustion and changing active-request options throw; native error mappings are unknown.

  • libSceHttp2 SSL callbacks - callback scheduling and refusal error mappings remain unverified on a console. The SSL-context/error-mask/certificate-chain/user-argument signature follows the on-device header. Zero accepts the chain; nonzero refuses it, following SharpProspero HTTPS callback semantics. libSceSsl supplies real peer handles and verification flags for each TLS hop. Refusal and unsupported verification failures throw while their native HTTP2 error mappings are unknown. Changing active-request options remains unsupported.

  • HTTP/1.x gzip inflation - console buffering, decoded-length reporting, host size limits and malformed-stream error mappings remain unverified. Enabled inflation uses the shared HTTP/2 decoder after HTTP/1 framing, retaining its 64 MiB encoded/decoded limits. Disabled inflation preserves wire bytes and lengths; bodyless responses retain their metadata.

Additional PS5 3.20 imports (xdCloudy #9485)

  • sceHttp2Unknown_*_nid_no_patch (libSceHttp2) - 1 PS5 3.20 import declarations (_Z5dummyv). Their prototypes and behavior are unverified; each uses the no-parameter import-resolution convention and throws through NotImplemented_nid_no_patch. This records the export names without claiming an ABI or behavior. Source: PS5-3.20_Libs.

  • libSceHttp2 authentication responses - Sony SDK/console handling of a 401 without WWW-Authenticate or a 407 without Proxy-Authenticate is unmeasured. This transport exposes the received status and body when the matching challenge field is absent, following the challenge/header distinction in RFC9110 section11.3. Matching fields still throw with automatic authentication enabled; challenge-value parsing, credential negotiation, caches and callbacks remain unimplemented. Informational headers do not carry authentication challenges into the final response.