electron-builder给程序数字签名,出现Can't sign app: The specified timestamp server either could not be reached

使用electron-builder出现错误:Can’t sign app: The specified timestamp server either could not be reached or returned an invalid response.

解决方案:修改package.json为

{
    "build":{
        "win":{
            "icon": "public/assets/icon.ico",
            "signingHashAlgorithms": [
            	"sha256"
            ],
            "signDlls": true,
            "rfc3161TimeStampServer": "http://timestamp.digicert.com",
            "certificateFile": 证书,
            "certificatePassword": 密码,
        }
    }
}

注意signingHashAlgorithms一定只写sha256,才会应用rfc3161TimeStampServer。如果写sha1,就会应用timeStampServer

参考自:

https://github.com/electron-userland/electron-builder/issues/2795

https://www.electron.build/configuration/win

https://github.com/MagicDev1/electron-builder/blob/d3db8750989d4c5b25f2fcd6d9c9d8a36f85fb2e/packages/app-builder-lib/src/codeSign/windowsCodeSign.ts

你可能感兴趣的:(js)