Skip to content

fix(sign): embed Developer ID intermediate so Apple notary accepts#22

Merged
gok03 merged 1 commit into
mainfrom
fix/macos-cert-chain
May 19, 2026
Merged

fix(sign): embed Developer ID intermediate so Apple notary accepts#22
gok03 merged 1 commit into
mainfrom
fix/macos-cert-chain

Conversation

@gok03
Copy link
Copy Markdown
Contributor

@gok03 gok03 commented May 19, 2026

Diagnosis

The v1.2.1 release got past goreleaser — `rcodesign sign` ran cleanly on each darwin binary — but Apple's notary rejected the submission (run 26098346551):

```
notary log> {
notary log> "path": "refuse_darwin_arm64.zip/refuse",
notary log> "message": "The binary is not signed with a valid Developer ID certificate."
notary log> }
```

Root cause

A typical Keychain Access `.p12` export only packages the leaf cert (`Developer ID Application: (TEAMID)`) + the matching private key. The intermediate (`Developer ID Certification Authority`) isn't included. rcodesign embeds whatever's in the .p12, so the resulting signature has the leaf only. Apple's notary can't trace the chain back to a trusted root, so the submission is marked `Invalid`.

Fix

`scripts/sign-macos.sh` now fetches the intermediate from Apple's stable URL (`https://www.apple.com/certificateauthority/DeveloperIDCA.cer\`) and passes it to rcodesign as an extra cert to embed:

```sh
rcodesign sign \
--p12-file "$p12" \
--p12-password "$MACOS_SIGN_PASSWORD" \
--certificate-der-file "$intermediate" \
--code-signature-flags runtime \
"$BINARY"
```

No re-export required from the user side. The intermediate cert is public.

Also turns `output: true` on the goreleaser hook so future failures in this script actually surface in the workflow log — previously the script's stdout/stderr was hidden, which is what kept the v1.2.1 debug blind.

Test plan

  • CI green on this PR
  • Merge → release-please opens v1.2.2 PR
  • Merge v1.2.2 → release.yaml runs:
    • `sign-macos: fetching Developer ID Certification Authority intermediate` visible in log
    • `sign-macos: signing dist/refuse_darwin_arm64_v8.0/refuse` visible
    • Notarize step succeeds without the "invalid cert" rejection
  • On a clean Mac: `brew install refusehq/tap/refuse` succeeds, `refuse --version` runs without the Gatekeeper dialog
  • `spctl --assess --type execute --verbose $(brew --prefix)/bin/refuse` shows `source=Notarized Developer ID`

The v1.2.1 release.yaml ran rcodesign successfully but Apple's notary
rejected with:

  "The binary is not signed with a valid Developer ID certificate."

A typical Keychain Access `.p12` export packages only the leaf cert
("Developer ID Application: <name> (TEAMID)") + private key — the
intermediate ("Developer ID Certification Authority") isn't included.
rcodesign embeds whatever's in the .p12, so the resulting signature
has the leaf only. Apple's notary can't trace the chain back to a
trusted root, so it marks the submission Invalid.

Fix: have sign-macos.sh fetch the intermediate from Apple's stable URL
and pass it to rcodesign as an extra cert to embed. No re-export
required from the user.

Also: turn `output: true` on the goreleaser hook so future failures in
this script actually surface in the workflow log — previously the
script's stdout/stderr was hidden, which is what kept this debugging
blind.
@gok03 gok03 merged commit 26b67f7 into main May 19, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant