1
votes

I am using generatePreSignedURL which is generating URL of the format ( Using Java SDK):

https://bucketName.s3.amazonaws.com/xyz/1765/1765877/RELATIVE/1765877?Expires=1390547709&AWSAccessKeyId=AKIAIFVBAWRYG72XANJA&Signature=ggHAYRTs2D4BQQnYIierEKGOWz0%3D

I want to use a customized domain using CNAME. Two issues:

  1. As CNAME doesnt work for HTTPS; I need to use http. How can generatePreSignedURL return http url. This is a small problem.. because I can anyway change it manually by replacing https to http but that doesnt look clean.

  2. After changing manually to http; and this URL bucketName.s3.amazonaws.com to customizeURL.com ; I get SignatureDoesNotMatch !! Any idea on how to fix this ? Can my generatePreSignedURL return customized URL ?

1

1 Answers

0
votes

To have generatePreSignedURL give you an http instead of https URL you have to set up your AmazonS3Client with a different ClientConfiguration. I've given an example below.

The customized domain over https is not possible now because AWS does not host client certs at this time for S3.

ClientConfiguration clientConfig = new ClientConfiguration();
clientConfig.setProtocol(Protocol.HTTP);
AmazonS3Client s3Client = new AmazonS3Client(awsCredentials, clientConfig);