fix(sign): fetch G2 Developer ID intermediate (the actual one our cert uses)#25
Merged
Conversation
Apple issues Developer ID certs from one of two intermediates:
G1: subject CN="Developer ID Certification Authority", OU="Apple
Certification Authority". URL: DeveloperIDCA.cer.
G2: subject CN="Developer ID Certification Authority", OU="G2". URL:
DeveloperIDG2CA.cer. Most certs issued from ~2018 onward.
The previous fix only fetched the G1 intermediate. Our actual cert is
issued by G2, so the embedded chain still couldn't be verified by
Apple's notary and submissions kept getting:
"The binary is not signed with a valid Developer ID certificate."
Fetch BOTH and embed both — `rcodesign sign` accepts
--certificate-der-file multiple times, and Apple's notary picks the
matching chain. Future-proofs against rotation.
Verified locally:
$ codesign -dvvv refuse
Authority=Developer ID Application: Gokulavasan Murali (837VZFQ23B)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
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.
Root cause of the lingering notary rejection
Apple issues Developer ID certs from one of two intermediates:
PR #22 only fetched the G1 cert. Our actual leaf is issued by G2 (issuer line: `OU=G2`), so the embedded chain still couldn't be verified by Apple's notary and submissions kept getting rejected with:
Fix
Fetch both intermediates and embed both. `rcodesign sign` accepts `--certificate-der-file` multiple times, and Apple's notary picks the matching chain. Future-proofs against rotation.
Also: while debugging, I found the previous `MACOS_SIGN_P12` secret was the wrong identity — it had an Apple Development cert, not the Developer ID Application cert. The user re-exported the correct `.p12` and updated the secret out-of-band.
Verified locally
Ran the script end-to-end against the corrected `.p12` on local hardware. Apple's own `codesign` reports the right chain:
```
Authority=Developer ID Application: Gokulavasan Murali (837VZFQ23B)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
TeamIdentifier=837VZFQ23B
flags=0x10000(runtime)
```
Test plan