Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-1090

jClouds not using AWS S3 V4 signature for Frankfurt region

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • jclouds-blobstore

    Description

      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("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);
      

      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)
      

      Attachments

        Issue Links

          Activity

            People

              gaul Andrew Gaul
              archupsg03 Archana Chinnaiah
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: