Connecting to R2 using rust_s3 package

I am trying to connect to my R2 bucket with the rust_s3 package. However, the presigned put and get URLs come up as “Unauthorized” when using then. Is there something wrong with my setup:

let credentials = Credentials::new(
        Option::from(<Cloudflare R2 Access Key Id>), // access_key
        Option::from(<Cloudflare R2 Secret Access Key>), // secret_key
        None,
        None,
        None,
    )
    .unwrap();

    let region = Region::Custom {
        region: "us-east-1",
        endpoint: "https://<accountid>.r2.cloudflarestorage.com",
    };

    Bucket::new(<bucket_name>, region, credentials)
        .unwrap()
        .with_path_style()

Presigned URLs are not currently supported with R2.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.