[
https://issues.apache.org/jira/browse/JCLOUDS-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15203564#comment-15203564
]
Andrew Gaul commented on JCLOUDS-1090:
--------------------------------------
I can confirm that the aws-s3 provider still uses the v2 signatures. I
committed several fixes for the v4 signatures in JCLOUDS-766 but one blocking
issue remains. v4 URL signing requires a content hash for the server to accept
the PUT request but the jclouds API does not allow for this. One workaround
would be to use v2 signatures for jclouds URL signing and v4 signatures for
other requests, which would work for most regions. If you can live without
this functionality, please use the following branch for now:
https://github.com/andrewgaul/jclouds/tree/aws-signature-v4
Unfortunately I cannot work on this further for a few weeks.
> jClouds not using AWS S3 V4 signature for Frankfurt region
> ----------------------------------------------------------
>
> Key: JCLOUDS-1090
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1090
> Project: jclouds
> Issue Type: Bug
> Components: jclouds-blobstore
> Affects Versions: 2.0.0
> Reporter: Archana Chinnaiah
> Priority: Blocker
>
> From the amazon documentation, we understand that the region eu-central-1
> (Frankfurt) supports only AWS signature version 4, and from
> https://issues.apache.org/jira/browse/JCLOUDS-480 we understand the jclouds
> already has the support added for version 4 signature.
> we have pulled the latest jclouds from master, and used the following client
> code, but it is not working.
> {noformat}
> BlobStoreContext context = ContextBuilder.newBuilder("aws-s3")
> .credentials("XXXXXXXXXXX", "YYYYYYYYYYYYYYYYYYY")
> .buildView(BlobStoreContext.class);
>
> // Access the BlobStore
> BlobStore blobStore = context.getBlobStore();
> Location loc = new
> LocationBuilder().scope(LocationScope.REGION)
> .id("eu-central-1")
> .description("region")
> .build();
> // Create a Container
> blobStore.createContainerInLocation(loc, containername);
> // Create a Blob
> File input = new File("sample.txt");
> long length = input.length();
> // Add a Blob
> Blob blob =
> blobStore.blobBuilder(objectname).payload(Files.asByteSource(input)).contentLength(length)
> .contentDisposition(objectname).build();
> // Upload the Blob
> String eTag = blobStore.putBlob(containername, blob);
> {noformat}
> we see the requests sent is using V2 signature, and the server is rejecting
> them for "eu-central-1".
> {noformat}
> 2016-03-08 14:57:57,044 DEBUG [jclouds.wire] [main] >> "Test[\n]"
> 2016-03-08 14:57:57,045 DEBUG [jclouds.headers] [main] >> PUT
> https://testcontainer3.s3-eu-central-1.amazonaws.com/file1 HTTP/1.1
> 2016-03-08 14:57:57,045 DEBUG [jclouds.headers] [main] >> Expect: 100-continue
> 2016-03-08 14:57:57,045 DEBUG [jclouds.headers] [main] >> Host:
> testcontainer3.s3-eu-central-1.amazonaws.com
> 2016-03-08 14:57:57,045 DEBUG [jclouds.headers] [main] >> Date: Tue, 08 Mar
> 2016 09:27:50 GMT
> 2016-03-08 14:57:57,045 DEBUG [jclouds.headers] [main] >> Authorization: AWS
> AKIAISCW6DRRITWR6IWQ:6AndVHQV2w75OXQDq/9sWt37KN0=
> 2016-03-08 14:57:57,045 DEBUG [jclouds.headers] [main] >> Content-Type:
> application/unknown
> 2016-03-08 14:57:57,045 DEBUG [jclouds.headers] [main] >> Content-Length: 5
> org.jclouds.http.HttpResponseException: Server rejected operation connecting
> to PUT https://testcontainer3.s3-eu-central-1.amazonaws.com/file1 HTTP/1.1
> at
> org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:118)
> at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90)
> at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73)
> at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)