0
  • 版本:22.9.1
  • 电子版
  • 电子类型(当前,测试版,夜间):11.1.0(稳定)
  • 目标:mac OS 11.1

  • 电子更新器版本:4.3.5

我将我的 S3 设置为私有 ( 看屏幕),然后将以下内容放入我的更新脚本中:

.......
autoUpdater.on('checking-for-update', () => {
            if (w !== undefined) {
                w.get('settings').content().send('check-for-updates-begin');
            }

            let opts = {
                service: 's3',
                region: 'eu-central-1',
                host: s3_bucket + '.s3.eu-central-1.amazonaws.com',
                path: '/latest-mac.yml' // For example....
            };
            aws4.sign(opts, {
                accessKeyId: "XXXXX",
                secretAccessKey: "XXXXXXXX"
            });

            autoUpdater.requestHeaders = opts.headers;
        });
........

不幸的是,我收到以下错误:

Error: HttpError: 403 Forbidden
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>

.....

有人给我解决方案吗?

4

1 回答 1

0

我的解决方案:

我为 autoUpdater 设置 FeedUrlautoUpdater.setFeedURL('https://[BUCKET].s3.[REGION].amazonaws.com');

于 2021-01-29T10:08:08.253 回答