# Electron-forge code signing issue

**URL:** <https://travis-ci.community/t/electron-forge-code-signing-issue/11940>\
**Category:** Windows\
**Created:** [August 6, 2021, 3:48am UTC](https://travis-ci.community/t/electron-forge-code-signing-issue/11940 "2021-08-06T03:48:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shib71](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/shib71/32/6965_2.png) [@shib71](https://travis-ci.community/u/shib71)\
**Post date:** [August 6, 2021, 3:48am UTC](https://travis-ci.community/t/electron-forge-code-signing-issue/11940/1 "2021-08-06T03:48:51Z")

</div>

This may be related to the other [Code signing](https://travis-ci.community/t/code-signing-error-on-windows-electron-build/11906) post, but it also might not, so I don’t want to muddy the waters of that thread.

I have a proof of concept electron project that uses electron-forge for building, packaging, and publishing. The whole process works on my local Windows PC, with the packages getting signed correctly. On the Travis CI VM I get a generic error:

> System.AggregateException: One or more errors occurred. —\> System.Exception: Failed to sign, command invoked was: ‘C:\Users\travis\build\daemonite\test-electron-project\node\_modules\electron-winstaller\vendor\signtool.exe sign /debug /f “C:\Users\travis\build\daemonite\test-electron-project\certificate.p12” /p “howisaravenlikeawritingdesk” C:\Users\travis\AppData\Local\SquirrelTemp\tempa\lib\net45\ffmpeg.dll’

This consistently occurs for the same file, `ffmpeg.dll`.

Unfortunately, the signtool binary that electron-forge provides doesn’t support the `/debug` flag. Adding it and doing manually calling it will be my next step to try and get more details.

I have checked:

- That the certificate file is in place and valid, by running `openssl pkcs12 -info -passin pass:$CERTIFICATE_WINDOWS_PASSWORD -in certificate.p12 -nodes`. I’m not going to include the output of that here, for obvious reasons, but it showed the certificate chain and private key as expected.
- If adding the cert to the store and using that instead works, per a comment on the other thread above.

```sh
> certutil -p $CERTIFICATE_WINDOWS_PASSWORD -importpfx $CERTIFICATE_P12
Certificate "NSW Education Standards Authority" added to store.

CertUtil: -importPFX command completed successfully.

```

Later, during the electron-build command:

> System.AggregateException: One or more errors occurred. —\> System.Exception: Failed to sign, command invoked was: ‘C:\Users\travis\build\daemonite\test-electron-project\node\_modules\electron-winstaller\vendor\signtool.exe sign /n “NSW Education Standards Authority” /a /f “C:\Users\travis\build\daemonite\test-electron-project\certificate.p12” /p “howisaravenlikeawritingdesk” C:\Users\travis\AppData\Local\SquirrelTemp\tempa\lib\net45\ffmpeg.dll’

For any Travis staff with build access, my latest builds are:

- Using the cert path and password configs for electron-forge: [Travis CI - Test and Deploy with Confidence](https://travis-ci.com/bitbucket/daemonite/test-electron-project/builds/234538236)
- Importing the cert and using the subject name: [Travis CI - Test and Deploy with Confidence](https://travis-ci.com/bitbucket/daemonite/test-electron-project/builds/234661925)

---

<div class="post-metadata">

**Author:** ![mustafa](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/mustafa/32/2752_2.png) [@mustafa](https://travis-ci.community/u/mustafa)\
**Post date:** [November 15, 2021, 12:16pm UTC](https://travis-ci.community/t/electron-forge-code-signing-issue/11940/2 "2021-11-15T12:16:49Z")

</div>

> <https://github.com/electron/windows-installer/issues/32>
>
> Not sure where to post this so starting here. When I try to sign our build using… \`certificateFile\` and \`certificatePassword\` I get the following stack trace:
> 
> \`\`\`
> Failed with exit code: 4294967295
> System.AggregateException: One or more errors occurred. ---\> System.Exception: Failed to sign, command invoked was: 'C:\\Users\\John\\Documents\\GitHub\\shrimp\\node\_modules\\electron-winstaller\\vendor\\signtool.exe sign /a /f "C:\\Users\\John\\Documents\\GitHub\\shrimp\\cert.pfx" /p "fake-pass" C:\\Users\\John\\AppData\\Local\\SquirrelTemp\\tempb\\lib\\net45\\shrimp.exe'
> at Squirrel.Update.Program.\<signPEFile\>d\_\_9a.MoveNext()
> \--- End of stack trace from previous location where exception was thrown ---
> at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
> at Squirrel.Utility.\<\>c\_\_DisplayClass1e\`1.\<\>c\_\_DisplayClass20.\<\<ForEachAsync\>b\_\_1d\>d\_\_22.MoveNext()
> --- End of inner exception stack trace ---
> at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
> at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
> at Squirrel.Update.Program.\<\>c\_\_DisplayClass78.\<Releasify\>b\_\_6a(String pkgPath)
> at Squirrel.ReleasePackage.CreateReleasePackage(String outputFile, String packagesRootDir, Func\`2 releaseNotesProcessor, Action\`1 contentsPostProcessHook)
> at Squirrel.Update.Program.Releasify(String package, String targetDir, String packagesDir, String bootstrapperExe, String backgroundGif, String signingOpts, String baseUrl, String setupIcon, Boolean generateMsi)
> at Squirrel.Update.Program.executeCommandLine(String\[\] args)
> at Squirrel.Update.Program.main(String\[\] args)
> at Squirrel.Update.Program.Main(String\[\] args)
> \---\> (Inner Exception #0) System.Exception: Failed to sign, command invoked was: 'C:\\Users\\John\\Documents\\GitHub\\shrimp\\node\_modules\\electron-winstaller\\vendor\\signtool.exe sign /a /f "C:\\Users\\John\\Documents\\GitHub\\shrimp\\cert.pfx" /p "fake-pass" C:\\Users\\John\\AppData\\Local\\SquirrelTemp\\tempb\\lib\\net45\\shrimp.exe'
> at Squirrel.Update.Program.\<signPEFile\>d\_\_9a.MoveNext()
> \--- End of stack trace from previous location where exception was thrown ---
> at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
> at Squirrel.Utility.\<\>c\_\_DisplayClass1e\`1.\<\>c\_\_DisplayClass20.\<\<ForEachAsync\>b\_\_1d\>d\_\_22.MoveNext()\<---
> 
> \---\> (Inner Exception #1) System.Exception: Failed to sign, command invoked was: 'C:\\Users\\John\\Documents\\GitHub\\shrimp\\node\_modules\\electron-winstaller\\vendor\\signtool.exe sign /a /f "C:\\Users\\John\\Documents\\GitHub\\shrimp\\cert.pfx" /p "fake-pass" C:\\Users\\John\\AppData\\Local\\SquirrelTemp\\tempb\\lib\\net45\\squirrel.exe'
> at Squirrel.Update.Program.\<signPEFile\>d\_\_9a.MoveNext()
> \--- End of stack trace from previous location where exception was thrown ---
> at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
> at Squirrel.Utility.\<\>c\_\_DisplayClass1e\`1.\<\>c\_\_DisplayClass20.\<\<ForEachAsync\>b\_\_1d\>d\_\_22.MoveNext()\<---
> \`\`\`
> 
> Couldn't see a clear problem in the trace, any ideas? Thanks!

Might help in this case.

---

<div class="post-metadata">

**Author:** ![mehdilaruelle](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/mehdilaruelle/32/8659_2.png) [@mehdilaruelle](https://travis-ci.community/u/mehdilaruelle)\
**Post date:** [March 30, 2023, 1:49pm UTC](https://travis-ci.community/t/electron-forge-code-signing-issue/11940/3 "2023-03-30T13:49:40Z")

</div>

Hey,

We got the same issue and same error output here.  
Any clue of this resolution ?

Thank!

---

<div class="post-metadata">

**Author:** ![shib71](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/shib71/32/6965_2.png) [@shib71](https://travis-ci.community/u/shib71)\
**Post date:** [March 31, 2023, 12:30am UTC](https://travis-ci.community/t/electron-forge-code-signing-issue/11940/4 "2023-03-31T00:30:23Z")

</div>

No. We don’t have to do many builds, so I ended up doing the Mac builds manually. Essentially: Travis CI doesn’t work for our use case. When/if we start building more often, I’ll check back to see if the problem has been resolved or if we should move elsewhere.
