Fix Apple ID sign-in failing with an HTML 503 (NSCocoaError 3840) - #1
Closed
izaankml wants to merge 1 commit into
Closed
Fix Apple ID sign-in failing with an HTML 503 (NSCocoaError 3840)#1izaankml wants to merge 1 commit into
izaankml wants to merge 1 commit into
Conversation
izaankml
force-pushed
the
fix/grandslam-503-sign-in
branch
from
September 5, 2026 05:53
88e1dfc to
ab1beb4
Compare
Since early September 2026 GrandSlam intermittently answers the sign-in requests with an HTML 503 page instead of a plist, which AltSign fed straight to PropertyListSerialization and surfaced as the opaque "Encountered unknown tag html on line 1" (NSCocoaError 3840). Two changes fix it: - Send the modern AuthKit User-Agent. Apple now rejects the obsolete akd/1.0 CFNetwork/978.0.7 Darwin/18.7.0 string a large fraction of the time; the AuthKit string current akd sends is accepted (measured on an affected Mac: old string 503'd 12/100, AuthKit 0/100). - Use a fresh ephemeral URLSession per request and retry. GrandSlam's edge assigns a keep-alive connection to one backend node; once that node starts failing, every later request on the same connection 503s and does not recover. Sign-in sends init, complete and apptokens over one shared session, so the third request always failed. A new connection per attempt, plus a bounded 5xx retry (up to 5 attempts, 1/2/4/8s backoff, within the ~30s anisette window), resolves it. Root cause and approach from altstoreio/AltStore#1776 (Calvin-Zikakis) and the upstream fixes in rileytestut#47/rileytestut#50/rileytestut#51.
izaankml
force-pushed
the
fix/grandslam-503-sign-in
branch
from
September 5, 2026 05:58
ab1beb4 to
2681a18
Compare
Author
|
Closing this. The same fix is upstream in rileytestut#50 (fresh connection per attempt plus 5xx retry, by Calvin-Zikakis) and rileytestut#51 (AuthKit User-Agent, by BreezeDelegate), both against
|
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.
Problem
Since early September 2026, signing in with an Apple ID fails with:
GrandSlam intermittently answers the sign-in requests with an HTML 503 page instead of a plist, and AltSign feeds that straight to
PropertyListSerialization, which reports the opaque 3840 parse error rather than the underlying server failure.Cause
Two things drive it:
akd/1.0 CFNetwork/978.0.7 Darwin/18.7.0. Apple now rejects that string with an HTML 503 a large fraction of the time. Measured on an affected Mac, 100 requests each: the old string 503'd 12 times, the modern AuthKit string 0 times.init,completeandapptokensover one sharedURLSession, so the first two succeed, the connection then starts failing, andapptokens(always third) gets the HTML 503.Fix
X-MMe-Client-Info.URLSession, so every attempt opens a new connection. Retry 5xx up to 5 times with 1/2/4/8s backoff, which stays within the ~30s anisette one-time-password window and keeps the request rate low enough not to trigger Apple's anti-abuse lock.Testing
Built AltServer and a patched AltStore for iOS from this fork against a live Apple ID on macOS 15.7.9 with an iOS device. Before:
apptokensreturned HTTP 503 (HTML) on every attempt. After:init,completeandapptokensall return HTTP 200 on the first attempt, and both AltStore install and on-device refresh sign in successfully.Credit
Root-cause analysis is from altstoreio/AltStore#1776 (Calvin-Zikakis), and the same approach is in the upstream pull requests rileytestut/AltSign#47, #50 and #51. This ports it to this fork's
macos-26-27line.