I have a basic Amazon S3 SDK code snippet that is used to retrieve a list of buckets. The server is configured to only accept TLSv1.2. I cannot configure my client to send a TLS v1.2 request, debugging shows that the client always sends TLSv1. I tried to set the system property, but this also does not work.
-Dhttps.protocols = TLSv1.2
BasicAWSCredentials credentials = new BasicAWSCredentials(username,password);
AmazonS3 s3 = new AmazonS3Client(credentials);
final String serviceurl = "https://ip:port";
s3.setEndpoint(serviceurl);
S3ClientOptions s3ClientOptions = new S3ClientOptions();
s3ClientOptions.setPathStyleAccess(false);
s3.setS3ClientOptions(s3ClientOptions);
for (Bucket bucket: s3.listBuckets()) {
System.out.println("Bucket name::" + bucket.getName());
}
What am I missing here? How to configure code to send a TLSv1.2 request? I am using the AWS SDK 1.7.25. Thank you for your help.
source
share