node.js – Electron Builder代码签名下载证书错误

我正在构建一个Electron应用程序并使用npm包电子构建器来构建
Windows的应用程序和安装程序.我正在尝试使用CSC_LINK和CSC_KEY_PASSWORD环境变量来签署应用程序,如下所述:
https://github.com/electron-userland/electron-builder#travis-appveyor-and-other-ci-servers

首次尝试错误和堆栈跟踪是:

Unhandled rejection Error: unable to verify the first certificate
at Error (native)
at TLSSocket.<anonymous> (_tls_wrap.js:1065:38)
at emitNone (events.js:80:13)
at TLSSocket.emit (events.js:179:7)
at TLSSocket._init.ssl.onclienthello.ssl.oncertcb.TLSSocket._finishInit (_tls_wrap.js:593:8)
at TLSWrap.ssl.onclienthello.ssl.oncertcb.ssl.onnewsession.ssl.onhandshakedone (_tls_wrap.js:425:38)
From previous event:
at Object.downloadCertificate (C:\projects\presentation\Electron\node_modules\electron-builder\src\codeSign.ts:97:18)
...

然后我尝试设置环境变量NODE_TLS_REJECT_UNAUTHORIZED = 0,现在得到一个不同的错误:

Unhandled rejection Error: Request error, status 400: Bad Request
at ClientRequest.<anonymous> (C:\projects\presentation\Electron\node_modules\electron-builder\src\httpRequest.ts:36:16)
...

在电子建设者的httpRequest.ts中调用的特定行似乎只是使用Node的https模块:https.request(…)https://github.com/electron-userland/electron-builder/blob/master/src/httpRequest.ts#L28

这让我相信Windows机器或证书存在问题.我在Windows 10,节点5.9.0上运行它.

最佳答案 最好直接向
https://github.com/electron-userland/electron-builder/issues提交问题以获得维护者的答复.我是活跃的当前维护者,不检查SO,所以,不太可能你得到快速回答;)

如果问题仍然适用于你,文件问题:)

点赞