env.dev

HTTPS_PROXY

Specifies the proxy server URL for HTTPS requests. Most tools check both HTTP_PROXY and HTTPS_PROXY separately. Can point to either an HTTP or HTTPS proxy server. In many environments, this is set to the same value as HTTP_PROXY.

Last updated:

HTTPS_PROXY routes outbound HTTPS (TLS) traffic through a proxy. Because the overwhelming majority of API calls, package downloads, and git-over-HTTPS traffic is encrypted, HTTPS_PROXY is the variable that actually matters in most corporate-proxy setups — HTTP_PROXY on its own barely covers anything. Confusingly, the value is usually still an `http://` URL even though it proxies HTTPS: the scheme describes how you reach the proxy (an unencrypted hop to a local/corporate proxy that then CONNECTs to the target), not the traffic being proxied.

Provider
General / OS
Category
network
Set by
Set manually or via corporate network configuration
Example
http://proxy.example.com:8080
Gotcha: People set HTTPS_PROXY=https://... and connections hang or fail. Unless your proxy itself terminates TLS, the URL should be http://proxy:port — the proxy tunnels HTTPS via the CONNECT method over a plain hop. Also, behind a TLS-inspecting corporate proxy you will hit certificate errors until you trust its root CA (e.g. via NODE_EXTRA_CA_CERTS, REQUESTS_CA_BUNDLE, or git's http.sslCAInfo).

How to set HTTPS_PROXY

bash

export HTTPS_PROXY=http://proxy.example.com:8080
export NO_PROXY=localhost,127.0.0.1,.internal

with proxy credentials

export HTTPS_PROXY=http://user:pass@proxy.example.com:8080

Frequently Asked Questions

Should HTTPS_PROXY start with http:// or https://?

Almost always http://. The scheme refers to how your machine reaches the proxy, not the traffic being proxied. A standard forward proxy accepts a plain connection and then tunnels your HTTPS via CONNECT, so HTTPS_PROXY=http://proxy:port is correct. Use https:// only if the proxy endpoint itself speaks TLS.

Was this helpful?

Stay up to date

Get notified about new guides, tools, and cheatsheets.

Browse all 242 environment variables →