Having reviewed every document, this has been going on for nearly two months. Originally, it was thought that the problem might be related to the fact I had created the developer ID signing certificate on an intel mac, and trying to import and use it on an M1 Mac-Mini. That turned out to not be the case. Completely started over with a new account (the company changed names), requested and was granted the entitlements we needed. Create a new CSR from this new m1 machine, created a Developer ID certificate, installed the certificate on this machine. But no matter what, the codesign fails.
Troubleshooting
- Environment:
- Brand new Apple Developer account and Developer ID Application certificate (generated CSR on this Mac, installed cert and private key in login keychain)
- macOS build/signing machine, not running codesign as root
- Working from Terminal app in GUI session, not via SSH/cron
- Keychain & Certificate Chain:
- Verified Developer ID Application: Fidelis Security LLC (J4WGF5B6KZ) certificate and private key are present in login keychain
- Verified certificate is marked as trusted and has a private key attached
- Developer ID Certification Authority present and trusted in System keychain (removed any extra from login)
- Evaluate certificate assistant shows everything is good
- Apple Root CA present and trusted in System keychain
- Set all trust settings back to System Defaults after testing with “Always Trust”
- No expired or duplicate Developer ID intermediates present
- codesign Troubleshooting:
- Ran:
- codesign --force --timestamp --options runtime --sign "Developer ID Application: Fidelis Security LLC (J4WGF5B6KZ)" ./fidelisevents
- Consistently received:
- Warning: unable to build chain to self-signed root for signer ...
- errSecInternalComponent
- Confirmed correct identity using:
- security find-identity -v -p codesigning
- (Shows my Developer ID Application cert as valid)
- security find-identity -v -p codesigning
- Keychain order confirmed with security list-keychains
- Tried explicit --keychain argument in codesign (no change)
- Additional Steps Attempted:
- Downloaded and re-installed all relevant Apple intermediates/root certificates from https://www.apple.com/certificateauthority/
- Rebooted the Mac and killed/restarted the securityd daemon
- Confirmed no use of sudo or root for codesigning
- Verified keychain is unlocked
- Checked that partition list grants access to codesign (set with security set-key-partition-list -S "apple:codesign:" -s -k "<pw>" ~/Library/Keychains/login.keychain-db)
- Attempted to codesign a copy of /usr/bin/true (same error)
- Ran codesign both with and without --timestamp, both on app bundle and binary
- Keychain Access showing:
- Certificate and private key present and linked
- Correct trust chain
- System keychain containing all Apple intermediates/roots
- No trust warnings or red Xs
Downloaded the latest Apple CA and Developer ID Root certificates and installed those.
None of the forum searches have helped. AI is likewise confused.
I’m glad you were able to recover your Developer ID signing identity. That allows for a bunch more tests. Let’s start with a simple one:
-
Create a new user account on the affected machine.
-
Import that
.p12
into your keychain. -
Import the Developer ID intermediate certificates from Apple PKI page, specifically, Developer ID - G1 and Developer ID - G2.
-
Re-run your signing test from Terminal.
Does this work?
If not, retry this process with a new user account on a different Mac.
Note In step 3, it’s fine to import both intermediates. The system will use the right one.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"