Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable HTTPS on AWS S3 using Java API

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();
like image 214
Horatiu Jeflea Avatar asked Jun 20 '17 10:06

Horatiu Jeflea


People also ask

Does S3 require HTTPS?

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.

Is Amazon S3 client thread safe Java?

Based on the Amazon Java SDK documentation I found that the s3Clients are thread safe objects.

Does AWS SDK use HTTP or HTTPS?

Communication over HTTPS is the default, and is more secure than HTTP, which is why AWS recommends using HTTPS.


1 Answers

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

like image 187
CantankerousBullMoose Avatar answered Sep 25 '22 16:09

CantankerousBullMoose