I want to use the Java API for S3 (getting an object) with plain HTTP (instead of HTTPS), but can't find the parameters to do so.
Currently I'm using a REST client to call http://s3.amazonaws.com instead of https://s3.amazonaws.com
Java API I am using:
AmazonS3 amazonS3 = AmazonS3ClientBuilder.defaultClient();
S3ObjectInputStream s3ObjectInputStream = amazonS3.getObject(getS3BotBucket(), resourceFile).getObjectContent();
Amazon S3 allows both HTTP and HTTPS requests. By default, requests are made through the AWS Management Console, AWS Command Line Interface (AWS CLI), or HTTPS.
Based on the Amazon Java SDK documentation I found that the s3Clients are thread safe objects.
Communication over HTTPS is the default, and is more secure than HTTP, which is why AWS recommends using HTTPS.
Get an instance of the client builder with AmazonS3ClientBuilder.standard()
.
Call withClientConfiguration(new ClientConfiguration.withProtocol(Protocol.HTTP))
on the client builder instance, then call the builder's build
method to get your S3 client instance that will use http instead of https
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With