- 版本**:22.9.1
- 电子版**:
- 电子类型(当前、beta、夜间)**:11.1.0(稳定)
- 目标**:mac OS 11.1
- 电子更新版本**:4.3.5
我将S3设置为private(
),然后将以下内容放入更新脚本中:
.......
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>
.....
有人能帮我解决吗?
2条答案
按热度按时间gtlvzcf81#
我的解决方案:
我为autoUpdater
autoUpdater.setFeedURL('https://[BUCKET].s3.[REGION].amazonaws.com');
设置了FeedUrla2mppw5e2#
如果其他人也有类似的问题并且setFeedUrl不起作用,请尝试以下操作:
https://github.com/electron-userland/electron-builder/issues/2355#issuecomment-724842574