aws-crt
v1.32.1
Published
NodeJS/browser bindings to the aws-c-* libraries
Readme
AWS CRT JS
NodeJS/Browser bindings for the AWS Common Runtime
License
This library is licensed under the Apache 2.0 License.
Building the package
Prereqs:
- Node 14+
- npm
- CMake 3.1+
- Linux: gcc 5+ or clang 3.6+
- If your compiler can compile node, it can compile this library
- Windows: Visual Studio 2015+
- OSX: XCode or brew-installed llvm
To build the package locally
git clone https://github.com/awslabs/aws-crt-nodejs.git
cd aws-crt-nodejs
git submodule update --init
npm installUsing From Your NodeJS Application
Normally, you just declare aws-crt as a dependency in your package.json file.
Using From Your Browser Application
You can either add it to package.json (if using a tool like webpack), or just import the dist.browser/ folder into your web project
Installing from npm
npm install aws-crtTo reduce the size of package, we put the C source code in the S3 bucket. If the platform you are using doesn't have the prebuilt binary, the install script will pull the source from S3 bucket. In case of no public internet access, you can specify the "CRT_BINARY_HOST" environment variable for the host of the source code. The build script will fetch source code from that host instead. To fetch the source from S3, you can reach to the cloudfront distribution (Only works for version after v1.9.2) https://d332vdhbectycy.cloudfront.net/aws-crt-<version>-source.tgz, the sha256 checksum https://d332vdhbectycy.cloudfront.net/aws-crt-<version>-source.sha256
Debug C part of code
After building the package locally, use node ./scripts/build.js --debug to enable debug. Then, attach any C debugger to use node to run jest
Mac-Only TLS Behavior
On macOS, both Apple Secure Transport and s2n-tls are compiled into the binary. By default, Apple Secure Transport is used as the TLS backend. You can switch to s2n-tls at runtime by setting the AWS_CRT_USE_NON_FIPS_TLS_13 environment variable.
This variable has no effect on Linux (which always uses s2n-tls) or Windows (which always uses Schannel).
| | Secure Transport (default) | s2n-tls (AWS_CRT_USE_NON_FIPS_TLS_13=1) |
|---|---|---|
| TLS versions | Up to TLS 1.2 | Up to TLS 1.3 |
| FIPS compliance | Yes | No |
| macOS Keychain integration | Yes (PKCS#12, system certs) | No |
Keychain Behavior (Secure Transport only)
When using the default 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.1.11, when a stored private key from the Keychain is used, the following will be logged at the "info" log level:
static: certificate has an existing certificate-key pair that was previously imported into the Keychain. Using key from Keychain instead of the one provided.