I have a basic Amazon S3 SDK code snippet which is used to retrieve a list of buckets. The server is configured to only accept TLSv1.2. I am not able to configure my client to send a TLS v1.2 request, debugging shows that client is always sending a TLSv1. I have tried setting the system property, but that does not work either.
-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 can I configure the code to always send a TLSv1.2 request? I am using AWS SDK 1.7.25. Thanks for your help.
Aucun commentaire:
Enregistrer un commentaire