Skip to content

Commit 610d9a7

Browse files
committed
Switch to https communication for Amazon APIs by default
We should use `https` by default instead of `http` for communication between elasticsearch and AWS API. Note that it can be modified in case of trouble and fallback to the older setting using `cloud.aws.protocol: http` Closes #109.
1 parent 0474a1b commit 610d9a7

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,18 @@ cloud:
4444

4545
### Transport security
4646

47-
By default this plugin uses HTTP for all API calls to AWS endpoints. If you wish to configure HTTPS you can set
47+
By default this plugin uses HTTPS for all API calls to AWS endpoints. If you wish to configure HTTP you can set
4848
`cloud.aws.protocol` in the elasticsearch config. You can optionally override this setting per individual service
4949
via: `cloud.aws.ec2.protocol` or `cloud.aws.s3.protocol`.
5050

5151
```
5252
cloud:
5353
aws:
54-
protocol: http
54+
protocol: https
5555
s3:
56-
protocol: https
57-
ec2:
5856
protocol: http
59-
57+
ec2:
58+
protocol: https
6059
```
6160

6261
### Region

src/main/java/org/elasticsearch/cloud/aws/AwsEc2Service.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public synchronized AmazonEC2 client() {
6060
}
6161

6262
ClientConfiguration clientConfiguration = new ClientConfiguration();
63-
String protocol = componentSettings.get("protocol", "http").toLowerCase();
63+
String protocol = componentSettings.get("protocol", "https").toLowerCase();
6464
protocol = componentSettings.get("ec2.protocol", protocol).toLowerCase();
6565
if ("http".equals(protocol)) {
6666
clientConfiguration.setProtocol(Protocol.HTTP);

src/main/java/org/elasticsearch/cloud/aws/InternalAwsS3Service.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919

2020
package org.elasticsearch.cloud.aws;
2121

22-
import java.util.HashMap;
23-
import java.util.Map;
24-
2522
import com.amazonaws.ClientConfiguration;
2623
import com.amazonaws.Protocol;
2724
import com.amazonaws.auth.*;
@@ -36,6 +33,9 @@
3633
import org.elasticsearch.common.settings.Settings;
3734
import org.elasticsearch.common.settings.SettingsFilter;
3835

36+
import java.util.HashMap;
37+
import java.util.Map;
38+
3939
/**
4040
*
4141
*/
@@ -88,7 +88,7 @@ private synchronized AmazonS3 getClient(String endpoint, String account, String
8888
}
8989

9090
ClientConfiguration clientConfiguration = new ClientConfiguration();
91-
String protocol = componentSettings.get("protocol", "http").toLowerCase();
91+
String protocol = componentSettings.get("protocol", "https").toLowerCase();
9292
protocol = componentSettings.get("s3.protocol", protocol).toLowerCase();
9393
if ("http".equals(protocol)) {
9494
clientConfiguration.setProtocol(Protocol.HTTP);

0 commit comments

Comments
 (0)