[jira] [Commented] (JCLOUDS-1090) jClouds not using AWS S3 V4 signature for Frankfurt region
[ https://issues.apache.org/jira/browse/JCLOUDS-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15213665#comment-15213665 ] ASF subversion and git services commented on JCLOUDS-1090: -- Commit 0f77386c77ce6ece4831426b26dfd80738bc30bb in jclouds's branch refs/heads/master from [~gaul] [ https://git-wip-us.apache.org/repos/asf?p=jclouds.git;h=0f77386 ] JCLOUDS-766: JCLOUDS-1090: Use AWS v4 signature Previous commits added support for v4 but did not default to it. URL signing continues to use v2 signatures due to a conflict between PUT requests and v4 content signing. Addresses AWSS3ServiceIntegrationLiveTest.testAllLocations test failures. > 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 >Assignee: Andrew Gaul >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("XXX", "YYY") > .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)
[jira] [Commented] (JCLOUDS-1090) jClouds not using AWS S3 V4 signature for Frankfurt region
[ https://issues.apache.org/jira/browse/JCLOUDS-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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("XXX", "YYY") > .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)
[jira] [Commented] (JCLOUDS-1090) jClouds not using AWS S3 V4 signature for Frankfurt region
[ https://issues.apache.org/jira/browse/JCLOUDS-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15199263#comment-15199263 ] Ignasi Barrera commented on JCLOUDS-1090: - You should be able to configure that without having to patch jclouds. When creating the context, just add the following module to the list of modules: {code:java} @ConfiguresHttpApi // This annotation is required so jclouds does not try to load the AWSS3HttpApiModule public static class AWSS3WithV4Signature extends AWSS3HttpApiModule { @Override protected void bindRequestSigner() { bind(RequestAuthorizeSignature.class).to(AWSRequestAuthorizeSignatureV4).in(Scopes.SINGLETON); } } ContextBuilder.newBuilder("aws-s3").modules(ImmutableSet.of(new AWSS3WithV4Signature(), ...)). ... {code} Could you please try it with the latest (unmodified) jclouds SNAPSHOT and see if it works? > 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. > BlobStoreContext context = ContextBuilder.newBuilder("aws-s3") > .credentials("XXX", "YYY") > .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); > we see the requests sent is using V2 signature, and the server is rejecting > them for "eu-central-1". > 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) > Thanks! -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (JCLOUDS-1090) jClouds not using AWS S3 V4 signature for Frankfurt region
[ https://issues.apache.org/jira/browse/JCLOUDS-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15198724#comment-15198724 ] Archana Chinnaiah commented on JCLOUDS-1090: I could make some changes in my jclouds 2.0.0 to make AWS signature version 4 as default, and make my client program talk to Frankfurt region. I did the following modification in the below mentioned files. Modified Files jclouds/providers/aws-s3/src/main/java/org/jclouds/aws/s3/config/AWSS3HttpApiModule.java @Override protected void bindRequestSigner() { bind(RequestAuthorizeSignature.class).to(AWSRequestAuthorizeSignatureV4.class).in(Scopes.SINGLETON); } jclouds/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/config/ @Override protected void bindRequestSigner() { bind(RequestAuthorizeSignature.class).to(AWSRequestAuthorizeSignatureV4.class).in(Scopes.SINGLETON); } Can some one take a look and let me know any other changes are required? I am interested in Amazon S3. > 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. > BlobStoreContext context = ContextBuilder.newBuilder("aws-s3") > .credentials("XXX", "YYY") > .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); > we see the requests sent is using V2 signature, and the server is rejecting > them for "eu-central-1". > 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) > Thanks! -- This message was sent by Atlassian JIRA (v6.3.4#6332)