Electron Builder 代碼簽名下載證書錯誤 (Electron Builder Code Signing Download Certificate Error)


問題描述

Electron Builder 代碼簽名下載證書錯誤 (Electron Builder Code Signing Download Certificate Error)

我正在構建一個 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 上運行它。

rel="nofollow">https://github.com/electron‑userland/electron‑builder/blob/master/src/httpRequest.ts#L28

這讓我相信與 Windows 機器或證書有關。我在 Windows 10 節點 5.9.0 上運行它。

rel="nofollow">https://github.com/electron‑userland/electron‑builder/blob/master/src/httpRequest.ts#L28

這讓我相信與 Windows 機器或證書有關。我在 Windows 10 節點 5.9.0 上運行它。


參考解法

方法 1:

It is better to file issue to https://github.com/electron‑userland/electron‑builder/issues directly to get answer from the maintainers. I am active current maintainer and don't check SO, so, unlikely that you get answer quickly ;)

If issue still actual for you, file issue :)

方法 2:

Not certain what the root of the issue was however I was able to get everything to work by moving the file to Dropbox. I still had to set NODE_TLS_REJECT_UNAUTHORIZED=0 and CSC_LINK needed to be set without quotes:

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

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

A link to the issue discussion on electron‑builder GitHub can be found here: https://github.com/electron‑userland/electron‑builder/issues/291

(by Denny FerrassolidevelarDenny Ferrassoli)

參考文件

  1. Electron Builder Code Signing Download Certificate Error (CC BY‑SA 2.5/3.0/4.0)

#electron-builder #electron #node.js






相關問題

Electron Builder 代碼簽名下載證書錯誤 (Electron Builder Code Signing Download Certificate Error)

Electron 使用 electron-builder 創建 MSI 安裝程序 (Electron create MSI installer using electron-builder)

如何使用電子/電子生成器創建發布通道? (How to create release channels with electron/electron-builder?)

electron-builder,如何設置節點環境變量 (electron-builder, how to set node environmental variables)

電子應用Mac應用商店圖標問題->“缺少必需的圖標” (electron app Mac app store icon issue -> "missing required icon")

帶有 Vue 和 vue-cli-plugin-electron-builder 的電子應用程序無法與 Tesseract.js 一起使用 (Electron App with Vue and vue-cli-plugin-electron-builder can't working with Tesseract.js)

使用 Electron-builder 自定義 NSIS 安裝程序 (Customize NSIS installer with Electron-builder)

在 Mac 中打開 Electron 應用程序時出錯:“file:///Applications/../Contents/Resources/app.asar/dist/index.html” (Error in Opening Electron App in Mac:"file:///Applications/../Contents/Resources/app.asar/dist/index.html")

Mac Os 10.11.6 中 Windows 的 Electron Pakaging 問題 (Electron Pakaging issue for Windows in Mac Os 10.11.6)

對於 Mac,是否有關於基於電子的應用程序卸載的事件?還是一種區分安裝和更新的方法? (Is there an event on electron based app's uninstall, for Mac? Or a way to distinguish between an install and an update?)

Electron 應用架構 - IPC 與 API (Electron application architecture - IPC vs API)

公證問題:altool 不在 PATH 中? (Notarize issue: altool not in PATH?)







留言討論