本文介绍如何在阿里云 CLI 中配置代理服务器，以通过代理访问和管理云服务。  

## **操作步骤**
阿里云 CLI 支持通过配置环境变量，使用代理服务器访问和管理云服务。配置信息如下表所示。配置方式请参见[在Linux、macOS和Windows系统配置环境变量](https://help.aliyun.com/document_detail/2766629.html)。

## 使用 HTTP 代理
<table> <thead> <tr> <td><p><b>变量名</b></p></td> <td><p><b>变量值</b></p></td> </tr> </thead> <colgroup></colgroup> <colgroup></colgroup> <tbody> <tr> <td><p><code>http_proxy</code></p></td> <td> <ul> <li><p>格式：<code>http://proxy_server_address:port</code></p></li> <li><p>示例：</p> <ul> <li><p><code>http://192.168.1.2:1234</code></p></li> <li><p><code>http://proxy.example.com:1234</code></p></li> </ul></li> </ul></td> </tr> </tbody> </table>

## 使用 HTTPS 代理
<table> <thead> <tr> <td><p><b>变量名</b></p></td> <td><p><b>变量值</b></p></td> </tr> </thead> <colgroup></colgroup> <colgroup></colgroup> <tbody> <tr> <td><p><code>HTTPS_PROXY</code> 或 <code>https_proxy</code></p><p>CLI 优先读取 <code>HTTPS_PROXY</code>，未设置时回退到 <code>https_proxy</code>。</p></td> <td> <ul> <li><p>格式：<code>https://proxy_server_address:port</code></p></li> <li><p>示例：</p> <ul> <li><p><code>https://192.168.1.2:5678</code></p></li> <li><p><code>https://proxy.example.com:5678</code></p></li> </ul></li> </ul></td> </tr> </tbody> </table>

## 跳过 TLS 证书验证
当企业代理使用自签名证书进行 TLS 中间人解密时，CLI 会报证书验证错误。可使用 `--skip-secure-verify` 跳过证书验证：

```
HELPCODEESCAPE-shell
aliyun ecs describe-regions --skip-secure-verify
```

如需永久生效，可通过 `configure set` 写入配置：

```
HELPCODEESCAPE-shell
aliyun configure set --skip-secure-verify
```

配置完成后，可执行任意 API 调用命令验证代理连通性。  
**警告**

跳过 TLS 证书验证会降低通信安全性，仅建议在信任的内网环境中使用。在公网环境中使用此选项可能导致凭证泄露。