Skip to content

Commit e1a26e1

Browse files
desokroshanrohandubal
authored andcommitted
Iot alpn support (#858)
* Add TLS ALPN support for AWS IoT MQTT connections * test testconfiguration.json * Revert "test testconfiguration.json" This reverts commit b8ad8c2. * Refactoring the API * Update config.yml * Update config.yml * Change config to run integration tests * Convert iot module to an android library * Refactor build.gradle * Update config.yml * Unit test fixes * Undo the config file change * Add dependency to pom.xml and add integration test for ALPN * Add reconnect test for connection on 443 * Test for connect followed by a disconnect * Package iot module as aar * Reset the circleci config * Synchronize the socket factory method and refactoring * Changelog entry for alpn * Changelog * Refactoring AWSIotSslUtility class and update the changelog
1 parent ecc8a45 commit e1a26e1

File tree

17 files changed

+281
-1232
lines changed

17 files changed

+281
-1232
lines changed

.circleci/config.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ workflows:
968968
branches:
969969
only:
970970
- master
971-
- develop
971+
- develop
972972
- integrationtest:
973973
name: apigateway
974974
testmodule: aws-android-sdk-apigateway-test
@@ -998,7 +998,7 @@ workflows:
998998
branches:
999999
only:
10001000
- master
1001-
- develop
1001+
- develop
10021002
- integrationtest:
10031003
name: comprehend
10041004
testmodule: aws-android-sdk-comprehend-test
@@ -1041,14 +1041,14 @@ workflows:
10411041
- develop
10421042
- integrationtest:
10431043
name: iot
1044-
testmodule: aws-android-sdk-iot-test
1044+
testmodule: aws-android-sdk-iot
10451045
requires:
10461046
- pre_integrationtest
10471047
filters:
10481048
branches:
10491049
only:
10501050
- master
1051-
- develop
1051+
- develop
10521052
- integrationtest:
10531053
name: kinesis
10541054
testmodule: aws-android-sdk-kinesis-test
@@ -1069,7 +1069,6 @@ workflows:
10691069
only:
10701070
- master
10711071
- develop
1072-
10731072
- integrationtest:
10741073
name: polly
10751074
testmodule: aws-android-sdk-polly-test
@@ -1109,7 +1108,7 @@ workflows:
11091108
branches:
11101109
only:
11111110
- master
1112-
- develop
1111+
- develop
11131112
- integrationtest:
11141113
name: ses
11151114
testmodule: aws-android-sdk-ses-test
@@ -1119,7 +1118,7 @@ workflows:
11191118
branches:
11201119
only:
11211120
- master
1122-
- develop
1121+
- develop
11231122
- integrationtest:
11241123
name: sns
11251124
testmodule: aws-android-sdk-sns-test
@@ -1129,7 +1128,7 @@ workflows:
11291128
branches:
11301129
only:
11311130
- master
1132-
- develop
1131+
- develop
11331132
- integrationtest:
11341133
name: sqs
11351134
testmodule: aws-android-sdk-sqs-test
@@ -1139,8 +1138,7 @@ workflows:
11391138
branches:
11401139
only:
11411140
- master
1142-
- develop
1143-
1141+
- develop
11441142
- integrationtest:
11451143
name: transcribe
11461144
testmodule: aws-android-sdk-transcribe-test
@@ -1150,7 +1148,7 @@ workflows:
11501148
branches:
11511149
only:
11521150
- master
1153-
- develop
1151+
- develop
11541152
- integrationtest:
11551153
name: translate
11561154
testmodule: aws-android-sdk-translate-test
@@ -1160,7 +1158,7 @@ workflows:
11601158
branches:
11611159
only:
11621160
- master
1163-
- develop
1161+
- develop
11641162
- integrationtest:
11651163
name: mobile-client
11661164
testmodule: aws-android-sdk-mobile-client
@@ -1170,7 +1168,7 @@ workflows:
11701168
branches:
11711169
only:
11721170
- master
1173-
- develop
1171+
- develop
11741172
- integrationtest:
11751173
name: CognitoIdentityProvider
11761174
testmodule: aws-android-sdk-cognitoidentityprovider-test
@@ -1180,7 +1178,7 @@ workflows:
11801178
branches:
11811179
only:
11821180
- master
1183-
- develop
1181+
- develop
11841182
- integrationtest:
11851183
name: Core
11861184
testmodule: aws-android-sdk-core-test
@@ -1190,7 +1188,7 @@ workflows:
11901188
branches:
11911189
only:
11921190
- master
1193-
- develop
1191+
- develop
11941192
- integrationtest:
11951193
name: CognitoAuth
11961194
testmodule: aws-android-sdk-cognitoauth
@@ -1200,7 +1198,7 @@ workflows:
12001198
branches:
12011199
only:
12021200
- master
1203-
- develop
1201+
- develop
12041202
# - integrationtest:
12051203
# name: kinesisvideo
12061204
# testmodule: aws-android-sdk-kinesisvideo
@@ -1220,7 +1218,7 @@ workflows:
12201218
# branches:
12211219
# only:
12221220
# - master
1223-
# - develop
1221+
# - develop
12241222
# - integrationtest:
12251223
# name: kinesisvideo-archivedmedia
12261224
# testmodule: aws-android-sdk-kinesisvideo-archivedmedia
@@ -1230,7 +1228,7 @@ workflows:
12301228
# branches:
12311229
# only:
12321230
# - master
1233-
# - develop
1231+
# - develop
12341232
- post_integrationtest:
12351233
requires:
12361234
# - kinesisvideo-archivedmedia
@@ -1387,7 +1385,7 @@ workflows:
13871385
only: /^(release|beta)_v[0-9]+.[0-9]+.[0-9]+$/
13881386
- integrationtest:
13891387
name: iot
1390-
testmodule: aws-android-sdk-iot-test
1388+
testmodule: aws-android-sdk-iot
13911389
requires:
13921390
- pre_integrationtest
13931391
filters:

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Change Log - AWS SDK for Android
22

3-
## [Release 2.12.7](https://github.com/aws/aws-sdk-android/releases/tag/release_v2.12.7)
3+
## [Release 2.13.0](https://github.com/aws/aws-sdk-android/releases/tag/release_v2.13.0)
4+
5+
### Enhancements
6+
7+
* **AWS IoT**
8+
* AWS IoT SDK for Android now supports MQTT over TLS with X.509 client certificate authentication on port 443. Previously this combination of protocol and authentication mechanism was only supported on port 8883. `connectUsingALPN()` method allows developers to connect to AWS IoT using client certificate authentication on port 443. Please look at [this blog](https://aws.amazon.com/blogs/iot/mqtt-with-tls-client-authentication-on-port-443-why-it-is-useful-and-how-it-works/) for more details.
9+
* **Breaking Change:** Please note that the type of aws-android-sdk-iot artifact is being changed from a`jar` to an `aar`. Also note that the `aar` artifacts needs to be explicitly specified in the dependency as `implementation ("com.amazonaws:aws-android-sdk-iot:2.12.+@aar") { transitive =true }` on some of the older versions of gradle.
410

511
### Enhancements
612

aws-android-sdk-iot-test/build.gradle

Lines changed: 0 additions & 45 deletions
This file was deleted.

aws-android-sdk-iot-test/proguard-rules.pro

Lines changed: 0 additions & 21 deletions
This file was deleted.

aws-android-sdk-iot/build.gradle

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,41 @@
1-
apply plugin: 'java-library'
1+
apply plugin: 'com.android.library'
22

3+
android {
4+
compileSdkVersion 27
5+
6+
7+
8+
defaultConfig {
9+
minSdkVersion 11
10+
targetSdkVersion 27
11+
versionCode 1
12+
versionName "1.0"
13+
14+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15+
16+
}
17+
18+
buildTypes {
19+
release {
20+
minifyEnabled false
21+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22+
}
23+
}
24+
25+
}
326
dependencies {
427
implementation fileTree(dir: 'libs', include: ['*.jar'])
528

6-
api project(":aws-android-sdk-core")
29+
api (project(":aws-android-sdk-core")){
30+
exclude group: "com.google.android", module: "android"
31+
}
732
implementation "org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.1.0"
33+
implementation "org.conscrypt:conscrypt-android:2.0.0"
834

935
testImplementation "junit:junit:4.12"
1036
testImplementation "org.robolectric:robolectric:2.4"
1137
testImplementation "org.mockito:mockito-all:1.10.5"
12-
}
13-
test {
14-
15-
if (project.hasProperty('excludeTests')) {
16-
exclude project.property('excludeTests')
17-
//exclude '**/*IntegrationTest.class'
18-
}
19-
}
20-
sourceCompatibility = "1.7"
21-
targetCompatibility = "1.7"
38+
androidTestImplementation "junit:junit:4.12"
39+
androidTestImplementation "com.android.support.test:runner:1.0.2"
40+
androidTestImplementation project(":aws-android-sdk-testutils")
41+
}

aws-android-sdk-iot/pom.xml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>com.amazonaws</groupId>
44
<artifactId>aws-android-sdk-iot</artifactId>
5-
<packaging>jar</packaging>
5+
<packaging>aar</packaging>
66
<name>AWS SDK for Android - AWS IoT</name>
77
<description>The AWS Android SDK for AWS IoT module holds the client classes that are used for communicating with AWS IoT Service</description>
88
<url>http://aws.amazon.com/sdkforandroid</url>
@@ -44,10 +44,28 @@
4444
<version>1.10.5</version>
4545
<scope>test</scope>
4646
</dependency>
47+
<dependency>
48+
<groupId>org.conscrypt</groupId>
49+
<artifactId>conscrypt-android</artifactId>
50+
<version>2.0.0</version>
51+
<type>aar</type>
52+
</dependency>
4753
</dependencies>
4854

4955
<build>
5056
<plugins>
57+
<plugin>
58+
<groupId>com.simpligility.maven.plugins</groupId>
59+
<artifactId>android-maven-plugin</artifactId>
60+
<version>4.5.0</version>
61+
<extensions>true</extensions>
62+
<configuration>
63+
<sdk>
64+
<platform>${env.ANDROID_PLATFORM}</platform>
65+
<buildTools>${env.ANDROID_BUILDTOOL_VERSION}</buildTools>
66+
</sdk>
67+
</configuration>
68+
</plugin>
5169
<plugin>
5270
<groupId>org.apache.maven.plugins</groupId>
5371
<artifactId>maven-compiler-plugin</artifactId>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import android.support.test.InstrumentationRegistry;
1919

20-
import com.amazonaws.iottest.R;
20+
import com.amazonaws.iot.R;
2121
import com.amazonaws.testutils.AWSTestBase;
2222

2323
import org.json.JSONObject;

0 commit comments

Comments
 (0)