随着 VS Code 版本:1.55.0 的更新,我看到以下新行为: 如果我向具有过期证书的服务器发送 POST https 请求,例如
const agent = https.Agent({rejectUnauthorized: false};
const response = await fetch('https://some-expired-cert-server.com/request', {
method: 'POST',
body: {},
headers,
agent: agent});
我收到异常“请求 https://some-expired-cert-server.com/request 失败,原因:证书已过期”
预期行为(或更新到 vscode 1.55.0 之前发生的情况)是当 rejectUnauthorized: false 时不会发生异常。
可能的解决方法是:
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
在代码中,但根据许多帖子,这是不可取的。
(我之前在 vscode github 中发布过,但被定向到这里)
这是我需要在扩展端更新的内容吗?