1*6236dae4SAndroid Build Coastguard Worker<!-- Copyright (C) Daniel Stenberg, <[email protected]>, et al. --> 2*6236dae4SAndroid Build Coastguard Worker<!-- SPDX-License-Identifier: curl --> 3*6236dae4SAndroid Build Coastguard Worker# ENVIRONMENT 4*6236dae4SAndroid Build Coastguard WorkerThe environment variables can be specified in lower case or upper case. The 5*6236dae4SAndroid Build Coastguard Workerlower case version has precedence. `http_proxy` is an exception as it is only 6*6236dae4SAndroid Build Coastguard Workeravailable in lower case. 7*6236dae4SAndroid Build Coastguard Worker 8*6236dae4SAndroid Build Coastguard WorkerUsing an environment variable to set the proxy has the same effect as using 9*6236dae4SAndroid Build Coastguard Workerthe --proxy option. 10*6236dae4SAndroid Build Coastguard Worker 11*6236dae4SAndroid Build Coastguard Worker## `http_proxy` [protocol://]<host>[:port] 12*6236dae4SAndroid Build Coastguard WorkerSets the proxy server to use for HTTP. 13*6236dae4SAndroid Build Coastguard Worker 14*6236dae4SAndroid Build Coastguard Worker## `HTTPS_PROXY` [protocol://]<host>[:port] 15*6236dae4SAndroid Build Coastguard WorkerSets the proxy server to use for HTTPS. 16*6236dae4SAndroid Build Coastguard Worker 17*6236dae4SAndroid Build Coastguard Worker## `[url-protocol]_PROXY` [protocol://]<host>[:port] 18*6236dae4SAndroid Build Coastguard WorkerSets the proxy server to use for [url-protocol], where the protocol is a 19*6236dae4SAndroid Build Coastguard Workerprotocol that curl supports and as specified in a URL. FTP, FTPS, POP3, IMAP, 20*6236dae4SAndroid Build Coastguard WorkerSMTP, LDAP, etc. 21*6236dae4SAndroid Build Coastguard Worker 22*6236dae4SAndroid Build Coastguard Worker## `ALL_PROXY` [protocol://]<host>[:port] 23*6236dae4SAndroid Build Coastguard WorkerSets the proxy server to use if no protocol-specific proxy is set. 24*6236dae4SAndroid Build Coastguard Worker 25*6236dae4SAndroid Build Coastguard Worker## `NO_PROXY` <comma-separated list of hosts/domains> 26*6236dae4SAndroid Build Coastguard Workerlist of hostnames that should not go through any proxy. If set to an asterisk 27*6236dae4SAndroid Build Coastguard Worker'*' only, it matches all hosts. Each name in this list is matched as either a 28*6236dae4SAndroid Build Coastguard Workerdomain name which contains the hostname, or the hostname itself. 29*6236dae4SAndroid Build Coastguard Worker 30*6236dae4SAndroid Build Coastguard WorkerThis environment variable disables use of the proxy even when specified with 31*6236dae4SAndroid Build Coastguard Workerthe --proxy option. That is 32*6236dae4SAndroid Build Coastguard Worker 33*6236dae4SAndroid Build Coastguard Worker NO_PROXY=direct.example.com curl -x http://proxy.example.com 34*6236dae4SAndroid Build Coastguard Worker http://direct.example.com 35*6236dae4SAndroid Build Coastguard Worker 36*6236dae4SAndroid Build Coastguard Workeraccesses the target URL directly, and 37*6236dae4SAndroid Build Coastguard Worker 38*6236dae4SAndroid Build Coastguard Worker NO_PROXY=direct.example.com curl -x http://proxy.example.com 39*6236dae4SAndroid Build Coastguard Worker http://somewhere.example.com 40*6236dae4SAndroid Build Coastguard Worker 41*6236dae4SAndroid Build Coastguard Workeraccesses the target URL through the proxy. 42*6236dae4SAndroid Build Coastguard Worker 43*6236dae4SAndroid Build Coastguard WorkerThe list of hostnames can also be include numerical IP addresses, and IPv6 44*6236dae4SAndroid Build Coastguard Workerversions should then be given without enclosing brackets. 45*6236dae4SAndroid Build Coastguard Worker 46*6236dae4SAndroid Build Coastguard WorkerIP addresses can be specified using CIDR notation: an appended slash and 47*6236dae4SAndroid Build Coastguard Workernumber specifies the number of "network bits" out of the address to use in the 48*6236dae4SAndroid Build Coastguard Workercomparison (added in 7.86.0). For example "192.168.0.0/16" would match all 49*6236dae4SAndroid Build Coastguard Workeraddresses starting with "192.168". 50*6236dae4SAndroid Build Coastguard Worker 51*6236dae4SAndroid Build Coastguard Worker## `APPDATA` <dir> 52*6236dae4SAndroid Build Coastguard WorkerOn Windows, this variable is used when trying to find the home directory. If 53*6236dae4SAndroid Build Coastguard Workerthe primary home variable are all unset. 54*6236dae4SAndroid Build Coastguard Worker 55*6236dae4SAndroid Build Coastguard Worker## `COLUMNS` <terminal width> 56*6236dae4SAndroid Build Coastguard WorkerIf set, the specified number of characters is used as the terminal width when 57*6236dae4SAndroid Build Coastguard Workerthe alternative progress-bar is shown. If not set, curl tries to figure it out 58*6236dae4SAndroid Build Coastguard Workerusing other ways. 59*6236dae4SAndroid Build Coastguard Worker 60*6236dae4SAndroid Build Coastguard Worker## `CURL_CA_BUNDLE` <file> 61*6236dae4SAndroid Build Coastguard WorkerIf set, it is used as the --cacert value. This environment variable is ignored 62*6236dae4SAndroid Build Coastguard Workerif Schannel is used as the TLS backend. 63*6236dae4SAndroid Build Coastguard Worker 64*6236dae4SAndroid Build Coastguard Worker## `CURL_HOME` <dir> 65*6236dae4SAndroid Build Coastguard WorkerIf set, is the first variable curl checks when trying to find its home 66*6236dae4SAndroid Build Coastguard Workerdirectory. If not set, it continues to check *XDG_CONFIG_HOME* 67*6236dae4SAndroid Build Coastguard Worker 68*6236dae4SAndroid Build Coastguard Worker## `CURL_SSL_BACKEND` <TLS backend> 69*6236dae4SAndroid Build Coastguard WorkerIf curl was built with support for "MultiSSL", meaning that it has built-in 70*6236dae4SAndroid Build Coastguard Workersupport for more than one TLS backend, this environment variable can be set to 71*6236dae4SAndroid Build Coastguard Workerthe case insensitive name of the particular backend to use when curl is 72*6236dae4SAndroid Build Coastguard Workerinvoked. Setting a name that is not a built-in alternative makes curl stay 73*6236dae4SAndroid Build Coastguard Workerwith the default. 74*6236dae4SAndroid Build Coastguard Worker 75*6236dae4SAndroid Build Coastguard WorkerSSL backend names (case-insensitive): **bearssl**, **gnutls**, **mbedtls**, 76*6236dae4SAndroid Build Coastguard Worker**openssl**, **rustls**, **schannel**, **secure-transport**, **wolfssl** 77*6236dae4SAndroid Build Coastguard Worker 78*6236dae4SAndroid Build Coastguard Worker## `HOME` <dir> 79*6236dae4SAndroid Build Coastguard WorkerIf set, this is used to find the home directory when that is needed. Like when 80*6236dae4SAndroid Build Coastguard Workerlooking for the default .curlrc. *CURL_HOME* and *XDG_CONFIG_HOME* 81*6236dae4SAndroid Build Coastguard Workerhave preference. 82*6236dae4SAndroid Build Coastguard Worker 83*6236dae4SAndroid Build Coastguard Worker## `QLOGDIR` <directory name> 84*6236dae4SAndroid Build Coastguard WorkerIf curl was built with HTTP/3 support, setting this environment variable to a 85*6236dae4SAndroid Build Coastguard Workerlocal directory makes curl produce **qlogs** in that directory, using file 86*6236dae4SAndroid Build Coastguard Workernames named after the destination connection id (in hex). Do note that these 87*6236dae4SAndroid Build Coastguard Workerfiles can become rather large. Works with the ngtcp2 and quiche QUIC backends. 88*6236dae4SAndroid Build Coastguard Worker 89*6236dae4SAndroid Build Coastguard Worker## `SHELL` 90*6236dae4SAndroid Build Coastguard WorkerUsed on VMS when trying to detect if using a **DCL** or a **Unix** shell. 91*6236dae4SAndroid Build Coastguard Worker 92*6236dae4SAndroid Build Coastguard Worker## `SSL_CERT_DIR` <dir> 93*6236dae4SAndroid Build Coastguard WorkerIf set, it is used as the --capath value. This environment variable is ignored 94*6236dae4SAndroid Build Coastguard Workerif Schannel is used as the TLS backend. 95*6236dae4SAndroid Build Coastguard Worker 96*6236dae4SAndroid Build Coastguard Worker## `SSL_CERT_FILE` <path> 97*6236dae4SAndroid Build Coastguard WorkerIf set, it is used as the --cacert value. This environment variable is ignored 98*6236dae4SAndroid Build Coastguard Workerif Schannel is used as the TLS backend. 99*6236dae4SAndroid Build Coastguard Worker 100*6236dae4SAndroid Build Coastguard Worker## `SSLKEYLOGFILE` <filename> 101*6236dae4SAndroid Build Coastguard WorkerIf you set this environment variable to a filename, curl stores TLS secrets 102*6236dae4SAndroid Build Coastguard Workerfrom its connections in that file when invoked to enable you to analyze the 103*6236dae4SAndroid Build Coastguard WorkerTLS traffic in real time using network analyzing tools such as Wireshark. This 104*6236dae4SAndroid Build Coastguard Workerworks with the following TLS backends: OpenSSL, LibreSSL (TLS 1.2 max), 105*6236dae4SAndroid Build Coastguard WorkerBoringSSL, GnuTLS and wolfSSL. 106*6236dae4SAndroid Build Coastguard Worker 107*6236dae4SAndroid Build Coastguard Worker## `USERPROFILE` <dir> 108*6236dae4SAndroid Build Coastguard WorkerOn Windows, this variable is used when trying to find the home directory. If 109*6236dae4SAndroid Build Coastguard Workerthe other, primary, variable are all unset. If set, curl uses the path 110*6236dae4SAndroid Build Coastguard Worker**"$USERPROFILE\Application Data"**. 111*6236dae4SAndroid Build Coastguard Worker 112*6236dae4SAndroid Build Coastguard Worker## `XDG_CONFIG_HOME` <dir> 113*6236dae4SAndroid Build Coastguard WorkerIf *CURL_HOME* is not set, this variable is checked when looking for a 114*6236dae4SAndroid Build Coastguard Workerdefault .curlrc file. 115