Swisscom S3 Dynamic Storage - 带有boto3的签名版本?

时间:2018-05-02 07:47:39

标签: swisscomdev

创建如此的S3客户端时:

s3 = boto3.client(
    's3',
    endpoint_url=app.config['S3_HOST'],
    aws_access_key_id=app.config['S3_SETTINGS']['accessKey'],
    aws_secret_access_key=app.config['S3_SETTINGS']['sharedSecret'],
    config=Config(signature_version='s3')
)

然后尝试上传文件:

s3.upload_fileobj(Fileobj=_file,
    Bucket=app.config['S3_BUCKET'],
    Key=file_hash,
    ExtraArgs={
        "Metadata": {
            "file_name": file_name
        }
    })

它抛出"Error: The request signature we calculated does not match the signature you provided. Check your key and signing method."

s3v4似乎也不起作用。我应该使用什么签名版本?

0 个答案:

没有答案