Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit e198f92

Browse files
authored
add NodeJS config to "Custom TLS certificates" (#743)
1 parent d05b3ce commit e198f92

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

content/en/references/custom-tls-certificates.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ There are three options when running LocalStack:
2323
They all can be summarised as:
2424

2525
1. get your proxy's custom certificate into the system certificate store, and
26-
2. configure [`requests`](https://pypi.python.org/pypi/requests) to use the custom certificate, and
27-
3. configure [`curl`](https://curl.se/) to use the custom certificate.
26+
2. configure [`requests`](https://pypi.python.org/pypi/requests) to use the custom certificate,
27+
3. configure [`curl`](https://curl.se/) to use the custom certificate, and
28+
4. configure [`node.js`](https://nodejs.org/) to use the custom certificate.
2829

2930
## Creating a custom docker image
3031

@@ -41,6 +42,7 @@ COPY <your custom certificate.crt> /usr/local/share/ca-certificates/cert-bundle.
4142
RUN update-ca-certificates
4243
ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
4344
ENV REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
45+
ENV NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
4446
```
4547

4648
and build the image:
@@ -93,6 +95,7 @@ Then run LocalStack with the environment variables
9395

9496
* `REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt`, and
9597
* `CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt`, and
98+
* `NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt`
9699

97100
and follow the instructions fn the [init hooks documentation]({{< ref "init-hooks" >}}) for configuring LocalStack to use the hook directory as a `boot` hook.
98101

@@ -107,20 +110,26 @@ On linux the custom certificate should be added to your `ca-certificates` bundle
107110
# update-ca-certificates
108111
{{< / command >}}
109112

110-
Then run LocalStack with the environment variables `REQUESTS_CA_BUNDLE` and `CURL_CA_BUNDLE`:
113+
Then run LocalStack with the environment variables `REQUESTS_CA_BUNDLE`, `CURL_CA_BUNDLE`, and `NODE_EXTRA_CA_CERTS``:
111114

112115
{{< command >}}
113-
$ CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt localstack start --host
116+
$ NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt \
117+
CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt \
118+
REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt \
119+
localstack start --host
114120
{{< / command >}}
115121

116122
### macOS
117123

118124
On macOS the custom certificate should be added to your keychain. See [this Apple support article](https://support.apple.com/en-gb/guide/keychain-access/kyca2431/mac) for more information.
119125

120-
Then run LocalStack with the environment variables `REQUESTS_CA_BUNDLE` and `CURL_CA_BUNDLE`:
126+
Then run LocalStack with the environment variables `REQUESTS_CA_BUNDLE`, `CURL_CA_BUNDLE`, and `NODE_EXTRA_CA_CERTS``:
121127

122128
{{< command >}}
123-
$ CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt localstack start --host
129+
$ NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt \
130+
CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt \
131+
REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt \
132+
localstack start --host
124133
{{< / command >}}
125134

126135
### Windows

0 commit comments

Comments
 (0)