Skip to content

Commit 3dd8ab4

Browse files
bbeausejkimihiro64
andauthored
Respect NODE_TLS_REJECT_UNAUTHORIZED environment variable under node (#2670)
* fix: Respect NODE_TLS_REJECT_UNAUTHORIZED environment when setting up the node Http Client sslAgent * chore: change log for bugfix-s3-8f3bc1d4.json * chore: change log component bugfix-node-s3-sqs-8f3bc1d4 * Add unit test for PR * Fix typo * Test should do no harm * style: linting errors fixed in node_http_client.spec * style: space-before-function-paren fix in node_http_client.spec Co-authored-by: kimihiro64 <[email protected]>
1 parent fb9e50e commit 3dd8ab4

File tree

3 files changed

+48
-3
lines changed

3 files changed

+48
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"type": "bugfix",
3+
"category": "node-s3-sqs",
4+
"description": "Respect the NODE_TLS_REJECT_UNAUTHORIZED environment under node when instantiating an http client sslAgent"
5+
}

lib/http/node.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ AWS.NodeHttpClient = AWS.util.inherit({
149149
if (useSSL) {
150150
if (!AWS.NodeHttpClient.sslAgent) {
151151
AWS.NodeHttpClient.sslAgent = new http.Agent(AWS.util.merge({
152-
rejectUnauthorized: true
152+
rejectUnauthorized: process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0' ? false : true
153153
}, agentOptions || {}));
154154
AWS.NodeHttpClient.sslAgent.setMaxListeners(0);
155155

test/node_http_client.spec.js

+42-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)