Slack webclient communication through proxy fails to verify slack.com certificate even though rejectUnauthorized: false is used in webclient agent #2140
Labels
needs info
An issue that is claimed to be a bug and hasn't been reproduced, or otherwise needs more info
pkg:web-api
applies to `@slack/web-api`
mitmproxy
is used):rejectUnauthorized: false
is used while instantiating the agent to avoid validating of the slack.com certificate. Nevertheless, the certificate validation occurs and fails with below error in the client (rest endpoint source code):and below error is seen in the
mitmproxy
logs:It's important to note that:
HTTPS_PROXY env var is
https://localhost:8080
(wheremitmproxy
listens)How to skip slack.com certificate validation when slack webclient is accessing it via a proxy?
There's no issue and slack API is successfully accessed via the proxy without certificate validation if
NODE_TLS_REJECT_UNAUTHORIZED=0
env var is present in the web service environment. However, it's a bad practice to disable certificate validation globally.Packages:
Select all that apply:
@slack/web-api
Reproducible in:
The Slack SDK version
6.12.0
Node.js runtime version
v18.20.4
OS info
20.04.1-Ubuntu
Expected result:
slack.com certificate validation will be skipped.
Actual result:
[WARN] web-api:WebClient:8 http request failed unable to verify the first certificate
The text was updated successfully, but these errors were encountered: