Amazon S3 custom endpoint results in invalid region, causing publishing to fail #1464
When using the system property "org.gradle.s3.endpoint" to specify a custom endpoint for S3 publishing or retrieval (e.g.
A made-up invalid region is used based on the provided hostname of the custom endpoint, e.g. for endpoint s3.example.com, the region sent to the server when publishing is "example"
The above bug renders it impossible to publish an artifact to a custom endpoint if the server rejects signatures with an invalid region. For example, if trying to publish to a minio server, the following error occurs:
1 - I changed the configuration of the minio server to set the configured region to the invalid one that Gradle chose to use (e.g. 'example'). This allowed Gradle to connect and the publish worked. Unfortunately, this broke other software that expected the region to be valid (e.g. Cyberduck is unable to create new buckets or upload files to minio in this configuration, because it expects the region to be set to the default region of US East 1 on custom endpoints)
2 - I created a new custom endpoint with a URL that had the format "s3-us-east-1.example.com" and pointed Gradle there instead. This caused Gradle to determine the region name "us-east-1" from the hostname, so publishing succeeded.
Steps to Reproduce
Specify a custom endpoint using the system property and attempt to publish. e.g.:
cross-reference: https://www.digitalocean.com/community/questions/maven-repository-on-digitalocean-spaces-any-luck - custom s3 endpoint for DigitalOcean spaces