Electron-forge code signing issue

This may be related to the other Code signing 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.
    > 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:

Imprint