SSL validation failed / EOF occurred when uploading large file to R2

For Workers & Pages, what is the name of the domain?

n/a

What is the error number?

n/a

What is the error message?

SSL validation failed for URL.com - MediaOptions EOF occurred in violation of protocol (_ssl.c:2406)

What is the issue or error you’re encountering

Cannot upload large files to r2

What steps have you taken to resolve the issue?

I have tried to upload via wrangler, awscli, and rclone

What are the steps to reproduce the issue?

Take a large file (in this case https://weights.replicate.delivery/default/black-forest-labs/FLUX.1-dev/files.tar) and try and upload it to an r2 bucket.

Screenshot of the error

Same thing happens with rclone.

Commands tried:

 aws s3api put-object --bucket base-weights --key flux-dev.tar --body flux-dev.tar --checksum-algorithm CRC32 --endpoint-url https://<id>.r2.cloudflarestorage.com  --no-verify-ssl
rclone copy -P flux-dev.tar r2:base-weights -vv --s3-upload-cutoff=100M --s3-chunk-size=100M