diff --git a/packages/electron-auto-updater/src/GenericProvider.ts b/packages/electron-auto-updater/src/GenericProvider.ts index 7a2378464f2..ea607a2b6fe 100644 --- a/packages/electron-auto-updater/src/GenericProvider.ts +++ b/packages/electron-auto-updater/src/GenericProvider.ts @@ -16,7 +16,7 @@ export class GenericProvider implements Provider { const channelFile = getChannelFilename(this.channel) const pathname = path.posix.resolve(this.baseUrl.pathname || "/", `${channelFile}`) try { - result = await request({hostname: this.baseUrl.hostname, port: this.baseUrl.port || "443", path: `${pathname}${this.baseUrl.search || ""}`}) + result = await request({hostname: this.baseUrl.hostname, port: this.baseUrl.port || "443", path: `${pathname}${this.baseUrl.search || ""}`, protocol: this.baseUrl.protocol}) } catch (e) { if (e instanceof HttpError && e.response.statusCode === 404) { diff --git a/packages/electron-auto-updater/src/electronHttpExecutor.ts b/packages/electron-auto-updater/src/electronHttpExecutor.ts index 62a3ba831d6..cb5e0b03e9c 100644 --- a/packages/electron-auto-updater/src/electronHttpExecutor.ts +++ b/packages/electron-auto-updater/src/electronHttpExecutor.ts @@ -41,6 +41,7 @@ export class ElectronHttpExecutor extends HttpExecutorrequestOptions.headers).authorization = token.startsWith("Basic") ? token : `token ${token}` } - requestOptions.protocol = "https:" + requestOptions.protocol = options.Protocol || "https:" return new BluebirdPromise((resolve, reject, onCancel) => { const request = net.request(options, response => { try {