Skip to content

Commit 20134ca

Browse files
committed
Support s2n-tls on macOS
1 parent 7bf12fc commit 20134ca

4 files changed

Lines changed: 58 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,57 @@ jobs:
124124
mvn test -Dtest=Mqtt5BuilderTest -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false
125125
source utils/test_cleanup.sh
126126
127+
# Test macOS with s2n-tls backend (TLS 1.3) instead of Apple Secure Transport
128+
osx-s2n-tls:
129+
runs-on: macos-latest
130+
strategy:
131+
fail-fast: false
132+
matrix:
133+
version:
134+
- 8
135+
- 11
136+
- 17
137+
env:
138+
AWS_CRT_USE_NON_FIPS_TLS_13: 1
139+
permissions:
140+
id-token: write # This is required for requesting the JWT
141+
steps:
142+
- name: Checkout Sources
143+
uses: actions/checkout@v2
144+
- name: Setup Java
145+
uses: actions/setup-java@v3.14.1
146+
with:
147+
distribution: ${{ matrix.version == 8 && 'corretto' || 'temurin' }}
148+
java-version: ${{ matrix.version }}
149+
cache: maven
150+
- name: Build ${{ env.PACKAGE_NAME }} + consumers
151+
run: |
152+
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
153+
chmod a+x builder
154+
./builder build -p ${{ env.PACKAGE_NAME }} --spec=downstream
155+
- name: configure AWS credentials (MQTT5)
156+
uses: aws-actions/configure-aws-credentials@v4
157+
with:
158+
role-to-assume: ${{ env.CI_MQTT5_ROLE }}
159+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
160+
- name: Service tests
161+
run: |
162+
source utils/test_setup.sh s3://iot-sdk-ci-bucket-us-east1/IotUsProdMqtt5EnvironmentVariables.txt us-east-1
163+
mvn test -Dtest=ShadowTests -Dsurefire.failIfNoSpecifiedTests=false
164+
mvn test -Dtest=JobsTests -Dsurefire.failIfNoSpecifiedTests=false
165+
mvn test -Dtest=IdentityTests -Dsurefire.failIfNoSpecifiedTests=false
166+
source utils/test_cleanup.sh
167+
- name: MQTT311 tests
168+
run: |
169+
source utils/test_setup.sh s3://iot-sdk-ci-bucket-us-east1/IotUsProdMqtt5EnvironmentVariables.txt us-east-1
170+
mvn test -Dtest=MqttBuilderTest -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false
171+
source utils/test_cleanup.sh
172+
- name: MQTT5 tests
173+
run: |
174+
source utils/test_setup.sh s3://iot-sdk-ci-bucket-us-east1/IotUsProdMqtt5EnvironmentVariables.txt us-east-1
175+
mvn test -Dtest=Mqtt5BuilderTest -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false
176+
source utils/test_cleanup.sh
177+
127178
linux-java-compat:
128179
runs-on: ubuntu-latest
129180
strategy:

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,12 @@ If you have a support plan with [AWS Support](https://aws.amazon.com/premiumsupp
100100

101101
#### Mac-Only TLS Behavior
102102

103-
> [!NOTE]
104-
> This SDK does not support TLS 1.3 on macOS. Support for TLS 1.3 on macOS is planned for a future release.
103+
By default, macOS uses Apple Secure Transport as the TLS implementation, which supports up to TLS 1.2. To enable TLS 1.3 on macOS, set the environment variable `AWS_CRT_USE_NON_FIPS_TLS_13=1` before running your application. This switches the TLS backend to s2n-tls with aws-lc at runtime.
105104

106-
Please note that on Mac, once a private key is used with a certificate, that certificate-key pair is imported into the Mac Keychain. All subsequent uses of that certificate will use the stored private key and ignore anything passed in programmatically. Beginning in v1.7.3, when a stored private key from the Keychain is used, the following will be logged at the "info" log level:
105+
> [!IMPORTANT]
106+
> Enabling `AWS_CRT_USE_NON_FIPS_TLS_13` trades FIPS compliance and macOS Keychain/PKCS#12 integration for TLS 1.3 support. This variable has no effect on Linux or Windows.
107+
108+
Please note that when using the default Apple Secure Transport backend, once a private key is used with a certificate, that certificate-key pair is imported into the Mac Keychain. All subsequent uses of that certificate will use the stored private key and ignore anything passed in programmatically. Beginning in v1.7.3, when a stored private key from the Keychain is used, the following will be logged at the "info" log level:
107109

108110
```
109111
static: certificate has an existing certificate-key pair that was previously imported into the Keychain.

android/iotdevicesdk/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ repositories {
114114
}
115115

116116
dependencies {
117-
api 'software.amazon.awssdk.crt:aws-crt-android:0.45.0'
117+
api 'software.amazon.awssdk.crt:aws-crt-android:0.47.0'
118118
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
119119
implementation 'org.slf4j:slf4j-api:1.7.30'
120120
implementation 'com.google.code.gson:gson:2.9.0'

sdk/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<dependency>
6161
<groupId>software.amazon.awssdk.crt</groupId>
6262
<artifactId>aws-crt</artifactId>
63-
<version>0.45.0</version>
63+
<version>0.47.0</version>
6464
</dependency>
6565
<dependency>
6666
<groupId>org.slf4j</groupId>

0 commit comments

Comments
 (0)