jcaddel / maven-s3-wagon

Multi-threaded wagon to connect Maven with Amazon S3
123 stars 50 forks source link

Allow configuring enablev4 system property #40

Open duaraghav8 opened 6 years ago

duaraghav8 commented 6 years ago

Hi, The wagon fails to authenticate successfully when the S3 bucket is present in a region that doesn't support AWS authentication v2 (since AWS java SDK uses v2 by default). However, it is possible to provide the system property com.amazonaws.services.s3.enableV4 to the sdk to make it switch to v4 authentication protocol. See https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/constant-values.html

For context, the auth failure message is:

Could not connect to repository: Status Code: 400, AWS Service: Amazon S3, AWS Request ID: XXXXXXXXXXX, AWS Error Code: InvalidRequest, AWS Error Message: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.

Is it currently possible to configure this system property in the wagon.

If not, I'd be happy to dig deeper and make a PR. I'm pretty new to the Java ecosystem so hopefully you'll bear with me :)

digitalkaoz commented 5 years ago

we are struggeling with something similar when trying to deploy into an KMS encrypted bucket:

AWS Error Message: Requests specifying Server Side Encryption with AWS KMS managed keys require AWS Signature Version 4

jhallen978 commented 5 years ago

According to AWS signature V2 is going to be deprecated in 21 days. On June 24, 2019 this plugin will be unsupported.

jhallen978 commented 5 years ago

Currently, only regions launched before 2014 support signature V2. So you may get that error if you are in an unsupported region.