blob: c8a65be04f389b1aab82ba6b27fd31e49073f410 [file] [log] [blame]
xf.li6c8fc1e2023-08-12 00:11:09 -07001.SH FILES
2.I ~/.curlrc
3.RS
4Default config file, see --config for details.
5.SH ENVIRONMENT
6The environment variables can be specified in lower case or upper case. The
7lower case version has precedence. http_proxy is an exception as it is only
8available in lower case.
9
10Using an environment variable to set the proxy has the same effect as using
11the --proxy option.
12
13.IP "http_proxy [protocol://]<host>[:port]"
14Sets the proxy server to use for HTTP.
15.IP "HTTPS_PROXY [protocol://]<host>[:port]"
16Sets the proxy server to use for HTTPS.
17.IP "[url-protocol]_PROXY [protocol://]<host>[:port]"
18Sets the proxy server to use for [url-protocol], where the protocol is a
19protocol that curl supports and as specified in a URL. FTP, FTPS, POP3, IMAP,
20SMTP, LDAP, etc.
21.IP "ALL_PROXY [protocol://]<host>[:port]"
22Sets the proxy server to use if no protocol-specific proxy is set.
23.IP "NO_PROXY <comma-separated list of hosts/domains>"
24list of host names that should not go through any proxy. If set to an asterisk
25'*' only, it matches all hosts. Each name in this list is matched as either
26a domain name which contains the hostname, or the hostname itself.
27
28This environment variable disables use of the proxy even when specified with
29the --proxy option. That is
30.B NO_PROXY=direct.example.com curl -x http://proxy.example.com
31.B http://direct.example.com
32accesses the target URL directly, and
33.B NO_PROXY=direct.example.com curl -x http://proxy.example.com
34.B http://somewhere.example.com
35accesses the target URL through the proxy.
36
37The list of host names can also be include numerical IP addresses, and IPv6
38versions should then be given without enclosing brackets.
39
40IPv6 numerical addresses are compared as strings, so they will only match if
41the representations are the same: "::1" is the same as "::0:1" but they do not
42match.
43.IP "APPDATA <dir>"
44On Windows, this variable is used when trying to find the home directory. If
45the primary home variable are all unset.
46.IP "COLUMNS <terminal width>"
47If set, the specified number of characters will be used as the terminal width
48when the alternative progress-bar is shown. If not set, curl will try to
49figure it out using other ways.
50.IP "CURL_CA_BUNDLE <file>"
51If set, will be used as the \fI--cacert\fP value.
52.IP "CURL_HOME <dir>"
53If set, is the first variable curl checks when trying to find its home
54directory. If not set, it continues to check \fBXDG_CONFIG_HOME\fP.
55.IP "CURL_SSL_BACKEND <TLS backend>"
56If curl was built with support for "MultiSSL", meaning that it has built-in
57support for more than one TLS backend, this environment variable can be set to
58the case insensitive name of the particular backend to use when curl is
59invoked. Setting a name that is not a built-in alternative will make curl
60stay with the default.
61
62SSL backend names (case-insensitive): bearssl, gnutls, gskit, mbedtls,
63nss, openssl, rustls, schannel, secure-transport, wolfssl
64.IP "HOME <dir>"
65If set, this is used to find the home directory when that is needed. Like when
66looking for the default .curlrc. \fBCURL_HOME\fP and \fBXDG_CONFIG_HOME\fP
67have preference.
68.IP "QLOGDIR <directory name>"
69If curl was built with HTTP/3 support, setting this environment variable to a
70local directory will make curl produce qlogs in that directory, using file
71names named after the destination connection id (in hex). Do note that these
72files can become rather large. Works with both QUIC backends.
73.IP SHELL
74Used on VMS when trying to detect if using a DCL or a "unix" shell.
75.IP "SSL_CERT_DIR <dir>"
76If set, will be used as the \fI--capath\fP value.
77.IP "SSL_CERT_FILE <path>"
78If set, will be used as the \fI--cacert\fP value.
79.IP "SSLKEYLOGFILE <file name>"
80If you set this environment variable to a file name, curl will store TLS
81secrets from its connections in that file when invoked to enable you to
82analyze the TLS traffic in real time using network analyzing tools such as
83Wireshark. This works with the following TLS backends: OpenSSL, libressl,
84BoringSSL, GnuTLS, NSS and wolfSSL.
85.IP "USERPROFILE <dir>"
86On Windows, this variable is used when trying to find the home directory. If
87the other, primary, variable are all unset. If set, curl will use the path
88"$USERPROFILE\\Application Data".
89.IP "XDG_CONFIG_HOME <dir>"
90If \fBCURL_HOME\fP is not set, this variable is checked when looking for a
91default .curlrc file.
92.SH "PROXY PROTOCOL PREFIXES"
93The proxy string may be specified with a protocol:// prefix to specify
94alternative proxy protocols. (Added in 7.21.7)
95
96If no protocol is specified in the proxy string or if the string does not match
97a supported one, the proxy will be treated as an HTTP proxy.
98
99The supported proxy protocol prefixes are as follows:
100.IP "http://"
101Makes it use it as an HTTP proxy. The default if no scheme prefix is used.
102.IP "https://"
103Makes it treated as an **HTTPS** proxy.
104.IP "socks4://"
105Makes it the equivalent of --socks4
106.IP "socks4a://"
107Makes it the equivalent of --socks4a
108.IP "socks5://"
109Makes it the equivalent of --socks5
110.IP "socks5h://"
111Makes it the equivalent of --socks5-hostname
112.SH EXIT CODES
113There are a bunch of different error codes and their corresponding error
114messages that may appear under error conditions. At the time of this writing,
115the exit codes are:
116.IP 0
117Success. The operation completed successfully according to the instructions.
118.IP 1
119Unsupported protocol. This build of curl has no support for this protocol.
120.IP 2
121Failed to initialize.
122.IP 3
123URL malformed. The syntax was not correct.
124.IP 4
125A feature or option that was needed to perform the desired request was not
126enabled or was explicitly disabled at build-time. To make curl able to do
127this, you probably need another build of libcurl.
128.IP 5
129Could not resolve proxy. The given proxy host could not be resolved.
130.IP 6
131Could not resolve host. The given remote host could not be resolved.
132.IP 7
133Failed to connect to host.
134.IP 8
135Weird server reply. The server sent data curl could not parse.
136.IP 9
137FTP access denied. The server denied login or denied access to the particular
138resource or directory you wanted to reach. Most often you tried to change to a
139directory that does not exist on the server.
140.IP 10
141FTP accept failed. While waiting for the server to connect back when an active
142FTP session is used, an error code was sent over the control connection or
143similar.
144.IP 11
145FTP weird PASS reply. Curl could not parse the reply sent to the PASS request.
146.IP 12
147During an active FTP session while waiting for the server to connect back to
148curl, the timeout expired.
149.IP 13
150FTP weird PASV reply, Curl could not parse the reply sent to the PASV request.
151.IP 14
152FTP weird 227 format. Curl could not parse the 227-line the server sent.
153.IP 15
154FTP cannot use host. Could not resolve the host IP we got in the 227-line.
155.IP 16
156HTTP/2 error. A problem was detected in the HTTP2 framing layer. This is
157somewhat generic and can be one out of several problems, see the error message
158for details.
159.IP 17
160FTP could not set binary. Could not change transfer method to binary.
161.IP 18
162Partial file. Only a part of the file was transferred.
163.IP 19
164FTP could not download/access the given file, the RETR (or similar) command
165failed.
166.IP 21
167FTP quote error. A quote command returned error from the server.
168.IP 22
169HTTP page not retrieved. The requested URL was not found or returned another
170error with the HTTP error code being 400 or above. This return code only
171appears if --fail is used.
172.IP 23
173Write error. Curl could not write data to a local filesystem or similar.
174.IP 25
175FTP could not STOR file. The server denied the STOR operation, used for FTP
176uploading.
177.IP 26
178Read error. Various reading problems.
179.IP 27
180Out of memory. A memory allocation request failed.
181.IP 28
182Operation timeout. The specified time-out period was reached according to the
183conditions.
184.IP 30
185FTP PORT failed. The PORT command failed. Not all FTP servers support the PORT
186command, try doing a transfer using PASV instead!
187.IP 31
188FTP could not use REST. The REST command failed. This command is used for
189resumed FTP transfers.
190.IP 33
191HTTP range error. The range "command" did not work.
192.IP 34
193HTTP post error. Internal post-request generation error.
194.IP 35
195SSL connect error. The SSL handshaking failed.
196.IP 36
197Bad download resume. Could not continue an earlier aborted download.
198.IP 37
199FILE could not read file. Failed to open the file. Permissions?
200.IP 38
201LDAP cannot bind. LDAP bind operation failed.
202.IP 39
203LDAP search failed.
204.IP 41
205Function not found. A required LDAP function was not found.
206.IP 42
207Aborted by callback. An application told curl to abort the operation.
208.IP 43
209Internal error. A function was called with a bad parameter.
210.IP 45
211Interface error. A specified outgoing interface could not be used.
212.IP 47
213Too many redirects. When following redirects, curl hit the maximum amount.
214.IP 48
215Unknown option specified to libcurl. This indicates that you passed a weird
216option to curl that was passed on to libcurl and rejected. Read up in the
217manual!
218.IP 49
219Malformed telnet option.
220.IP 52
221The server did not reply anything, which here is considered an error.
222.IP 53
223SSL crypto engine not found.
224.IP 54
225Cannot set SSL crypto engine as default.
226.IP 55
227Failed sending network data.
228.IP 56
229Failure in receiving network data.
230.IP 58
231Problem with the local certificate.
232.IP 59
233Could not use specified SSL cipher.
234.IP 60
235Peer certificate cannot be authenticated with known CA certificates.
236.IP 61
237Unrecognized transfer encoding.
238.IP 63
239Maximum file size exceeded.
240.IP 64
241Requested FTP SSL level failed.
242.IP 65
243Sending the data requires a rewind that failed.
244.IP 66
245Failed to initialise SSL Engine.
246.IP 67
247The user name, password, or similar was not accepted and curl failed to log in.
248.IP 68
249File not found on TFTP server.
250.IP 69
251Permission problem on TFTP server.
252.IP 70
253Out of disk space on TFTP server.
254.IP 71
255Illegal TFTP operation.
256.IP 72
257Unknown TFTP transfer ID.
258.IP 73
259File already exists (TFTP).
260.IP 74
261No such user (TFTP).
262.IP 77
263Problem reading the SSL CA cert (path? access rights?).
264.IP 78
265The resource referenced in the URL does not exist.
266.IP 79
267An unspecified error occurred during the SSH session.
268.IP 80
269Failed to shut down the SSL connection.
270.IP 82
271Could not load CRL file, missing or wrong format (added in 7.19.0).
272.IP 83
273Issuer check failed (added in 7.19.0).
274.IP 84
275The FTP PRET command failed.
276.IP 85
277Mismatch of RTSP CSeq numbers.
278.IP 86
279Mismatch of RTSP Session Identifiers.
280.IP 87
281Unable to parse FTP file list.
282.IP 88
283FTP chunk callback reported error.
284.IP 89
285No connection available, the session will be queued.
286.IP 90
287SSL public key does not matched pinned public key.
288.IP 91
289Invalid SSL certificate status.
290.IP 92
291Stream error in HTTP/2 framing layer.
292.IP 93
293An API function was called from inside a callback.
294.IP 94
295An authentication function returned an error.
296.IP 95
297A problem was detected in the HTTP/3 layer. This is somewhat generic and can
298be one out of several problems, see the error message for details.
299.IP 96
300QUIC connection error. This error may be caused by an SSL library error. QUIC
301is the protocol used for HTTP/3 transfers.
302.IP XX
303More error codes will appear here in future releases. The existing ones
304are meant to never change.
305.SH BUGS
306If you experience any problems with curl, submit an issue in the project's bug
307tracker on GitHub: https://github.com/curl/curl/issues
308.SH AUTHORS / CONTRIBUTORS
309Daniel Stenberg is the main author, but the whole list of contributors is
310found in the separate THANKS file.
311.SH WWW
312https://curl.se
313.SH "SEE ALSO"
314.BR ftp (1),
315.BR wget (1)