#Code signing not working electron forge

3 messages · Page 1 of 1 (latest)

distant thorn
#

Hey guys, I have a question about code-signing my electron app for macOS. I am using electron forge and I have followed the guide in the documentation for both code-signing and notarization. When the app is sent for notarization from CLI, I get the following error:

An unhandled rejection has occurred inside Forge:
Error: Failed to staple your application with code: 66

Processing: /private/var/folders/2c/h17wlq4n43bc0dyd06k3w9800000gn/T/electron-packager/darwin-x64/myapp-desktop-darwin-x64-aC1KKS/myapp-desktop.app
Properties are {
NSURLIsDirectoryKey = 1;
NSURLIsPackageKey = 1;
NSURLIsSymbolicLinkKey = 0;
NSURLLocalizedTypeDescriptionKey = Application;
NSURLTypeIdentifierKey = "com.apple.application-bundle";
"_NSURLIsApplicationKey" = 1;
}
Props are {
}
Cannot download ticket. CDHash must be set.

I have a valid certificate downloaded on my machine, however when I run "security find-identity -p codesigning -v" I get 0 valid identities. When running just "security-find-identity", I get 5 certificates back, including the one I need in this case. I assume the error lies here somewhere, that my app is not codesigned because it can't find the certificate. I have been trying all suggestions I can find to get my certificate to be picked up, but nothing I have found on the apple developer forums or in electron forge docs has worked.

Does anyone have a clue what my next steps would be?

Sorry for the long message, and I would greatly appreciate any pointers on where to proceed from here.

Best regards

jolly cloud
distant thorn
#

Thanks for getting back to me, I worked all night and finally figured out what my issue was. For some reason my certificate was not added to the keychain properly, once I reinstalled everything through xcode I was able to get both code signing and notarization to work!

Have a good day! 😊 @jolly cloud