Skip to content

Commit 884b575

Browse files
committed
Merge branch 'main' into o_direct
2 parents 8d0502c + 0bb3f49 commit 884b575

23 files changed

Lines changed: 1273 additions & 100 deletions

.github/workflows/ci.yml

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- 'docs'
88

99
env:
10-
BUILDER_VERSION: v0.9.92
10+
BUILDER_VERSION: v0.9.93
1111
BUILDER_SOURCE: releases
1212
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
1313
PACKAGE_NAME: aws-crt-python
@@ -50,13 +50,11 @@ jobs:
5050
- x64
5151
- x86
5252
python:
53-
- cp38-cp38
5453
- cp39-cp39
5554
- cp310-cp310
5655
- cp311-cp311
5756
- cp312-cp312
5857
- cp313-cp313
59-
- cp313-cp313t
6058
- cp314-cp314
6159
- cp314-cp314t
6260
permissions:
@@ -78,13 +76,11 @@ jobs:
7876
fail-fast: false
7977
matrix:
8078
python:
81-
- cp38-cp38
8279
- cp39-cp39
8380
- cp310-cp310
8481
- cp311-cp311
8582
- cp312-cp312
8683
- cp313-cp313
87-
- cp313-cp313t
8884
- cp314-cp314
8985
- cp314-cp314t
9086
permissions:
@@ -344,6 +340,42 @@ jobs:
344340
chmod a+x builder
345341
./builder build -p ${{ env.PACKAGE_NAME }}
346342
343+
macos-s2n:
344+
runs-on: macos-14 # latest
345+
env:
346+
AWS_CRT_USE_NON_FIPS_TLS_13: 1
347+
permissions:
348+
id-token: write # This is required for requesting the JWT
349+
steps:
350+
- name: configure AWS credentials (containers)
351+
uses: aws-actions/configure-aws-credentials@v4
352+
with:
353+
role-to-assume: ${{ env.CRT_CI_ROLE }}
354+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
355+
- name: Build ${{ env.PACKAGE_NAME }} + consumers
356+
run: |
357+
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
358+
chmod a+x builder
359+
./builder build -p ${{ env.PACKAGE_NAME }}
360+
361+
macos-x64-s2n:
362+
runs-on: macos-14-large # latest
363+
env:
364+
AWS_CRT_USE_NON_FIPS_TLS_13: 1
365+
permissions:
366+
id-token: write # This is required for requesting the JWT
367+
steps:
368+
- name: configure AWS credentials (containers)
369+
uses: aws-actions/configure-aws-credentials@v4
370+
with:
371+
role-to-assume: ${{ env.CRT_CI_ROLE }}
372+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
373+
- name: Build ${{ env.PACKAGE_NAME }} + consumers
374+
run: |
375+
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
376+
chmod a+x builder
377+
./builder build -p ${{ env.PACKAGE_NAME }}
378+
347379
openbsd:
348380
runs-on: ubuntu-24.04 # latest
349381
strategy:

README.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,33 @@ If you **must** use fork with aws-crt-python, you may be able to avoid hangs and
4949

5050
For an example, see `test.test_s3.py.S3RequestTest.test_fork_workaround` .
5151

52-
## Mac-Only TLS Behavior
52+
## macOS TLS Configuration
5353

54-
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 v0.6.2, when a stored private key from the Keychain is used, the following will be logged at the "info" log level:
54+
By default on macOS, aws-crt-python uses Apple Secure Transport for TLS. This provides FIPS-compliant cryptography
55+
and integration with the macOS Keychain (e.g. PKCS#12 credentials), but is limited to TLS 1.2.
56+
57+
To enable TLS 1.3 on macOS, set the environment variable:
58+
59+
```
60+
export AWS_CRT_USE_NON_FIPS_TLS_13=1
61+
```
62+
63+
This switches the TLS backend from Apple Secure Transport to [s2n-tls](https://github.com/aws/s2n-tls) with
64+
[aws-lc](https://github.com/aws/aws-lc) as the underlying libcrypto. The tradeoffs are:
65+
66+
| | Secure Transport (default) | s2n-tls (`AWS_CRT_USE_NON_FIPS_TLS_13=1`) |
67+
|---|---|---|
68+
| TLS versions | Up to TLS 1.2 | Up to TLS 1.3 |
69+
| FIPS compliance | Yes | No |
70+
| macOS Keychain integration | Yes (PKCS#12, system certs) | No |
71+
72+
This variable is checked at runtime and only affects macOS. It has no effect on Linux (which always uses s2n-tls)
73+
or Windows (which always uses Schannel). Both TLS backends are compiled into the binary when building on macOS;
74+
the environment variable selects which one is used.
75+
76+
### Keychain Behavior
77+
78+
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 v0.6.2, when a stored private key from the Keychain is used, the following will be logged at the "info" log level:
5579

5680
```
5781
static: certificate has an existing certificate-key pair that was previously imported into the Keychain. Using key from Keychain instead of the one provided.
@@ -110,8 +134,9 @@ You can enable the crash handler by setting the environment variable `AWS_CRT_CR
110134
### OpenSSL and LibCrypto
111135

112136
aws-crt-python does not use OpenSSL for TLS.
113-
On Apple and Windows devices, the OS's default TLS library is used.
114-
On Unix devices, [s2n-tls](https://github.com/aws/s2n-tls) is used.
137+
On Windows, the OS's default TLS library (Schannel) is used.
138+
On Apple (macOS), both Secure Transport and s2n-tls are compiled in; the backend is selected at runtime (see [macOS TLS Configuration](#macos-tls-configuration) below).
139+
On other Unix devices, [s2n-tls](https://github.com/aws/s2n-tls) is used.
115140
But s2n-tls uses libcrypto, the cryptography math library bundled with OpenSSL.
116141

117142
To simplify installation, aws-crt-python has its own copy of libcrypto.

awscrt/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33

44
from weakref import WeakSet
55

6+
67
__all__ = [
78
'aio',
89
'auth',
10+
'aws_iot_metrics',
911
'crypto',
1012
'http',
1113
'io',

awscrt/_aws_iot_metrics.py

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

0 commit comments

Comments
 (0)