【问题标题】:Electron Builder Code Signing Download Certificate ErrorElectron Builder 代码签名下载证书错误
【发布时间】:2016-07-18 20:38:35
【问题描述】:

我正在构建一个 Electron 应用程序并使用 npm 包 electron-builder 来构建适用于 Windows 的应用程序和安装程序。我正在尝试使用CSC_LINKCSC_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)
...

在 electron-builder 的 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 上运行它。

【问题讨论】:

    标签: node.js electron electron-builder


    【解决方案1】:

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

    如果问题对您来说仍然存在,请提交问题 :)

    【讨论】:

      【解决方案2】:

      不确定问题的根源是什么,但是通过将文件移动到 Dropbox,我能够让一切正常工作。我仍然需要设置 NODE_TLS_REJECT_UNAUTHORIZED=0CSC_LINK 需要设置不带引号:

      成功: SET CSC_LINK=https://www.dropbox.com/s/path/to/file.p12?dl=1

      失败: SET CSC_LINK="https://www.dropbox.com/s/path/to/file.p12?dl=1"

      electron-builder GitHub 上的问题讨论链接可以在这里找到:https://github.com/electron-userland/electron-builder/issues/291

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-07-31
        • 2012-08-01
        • 2017-01-31
        • 1970-01-01
        • 1970-01-01
        • 2014-02-03
        • 1970-01-01
        • 2021-01-03
        相关资源
        最近更新 更多