Install curl-7.21.1.tar.bz2
[msysgit.git] / mingw / share / man / man3 / curl_easy_setopt.3
blob1704f6ad01bc41d2bf127fefa30fa442c9d5544c
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at http://curl.haxx.se/docs/copyright.html.
13 .\" *
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" **************************************************************************
22 .\"
23 .TH curl_easy_setopt 3 "1 Jan 2010" "libcurl 7.20.0" "libcurl Manual"
24 .SH NAME
25 curl_easy_setopt \- set options for a curl easy handle
26 .SH SYNOPSIS
27 #include <curl/curl.h>
29 CURLcode curl_easy_setopt(CURL *handle, CURLoption option, parameter);
30 .SH DESCRIPTION
31 curl_easy_setopt() is used to tell libcurl how to behave. By using the
32 appropriate options to \fIcurl_easy_setopt\fP, you can change libcurl's
33 behavior.  All options are set with the \fIoption\fP followed by a
34 \fIparameter\fP. That parameter can be a \fBlong\fP, a \fBfunction pointer\fP,
35 an \fBobject pointer\fP or a \fBcurl_off_t\fP, depending on what the specific
36 option expects. Read this manual carefully as bad input values may cause
37 libcurl to behave badly!  You can only set one option in each function call. A
38 typical application uses many curl_easy_setopt() calls in the setup phase.
40 Options set with this function call are valid for all forthcoming transfers
41 performed using this \fIhandle\fP.  The options are not in any way reset
42 between transfers, so if you want subsequent transfers with different options,
43 you must change them between the transfers. You can optionally reset all
44 options back to internal default with \fIcurl_easy_reset(3)\fP.
46 Strings passed to libcurl as 'char *' arguments, are copied by the library;
47 thus the string storage associated to the pointer argument may be overwritten
48 after curl_easy_setopt() returns. Exceptions to this rule are described in
49 the option details below.
51 Before version 7.17.0, strings were not copied. Instead the user was forced
52 keep them available until libcurl no longer needed them.
54 The \fIhandle\fP is the return code from a \fIcurl_easy_init(3)\fP or
55 \fIcurl_easy_duphandle(3)\fP call.
56 .SH BEHAVIOR OPTIONS
57 .IP CURLOPT_VERBOSE
58 Set the parameter to 1 to get the library to display a lot of verbose
59 information about its operations. Very useful for libcurl and/or protocol
60 debugging and understanding. The verbose information will be sent to stderr,
61 or the stream set with \fICURLOPT_STDERR\fP.
63 You hardly ever want this set in production use, you will almost always want
64 this when you debug/report problems. Another neat option for debugging is the
65 \fICURLOPT_DEBUGFUNCTION\fP.
66 .IP CURLOPT_HEADER
67 A parameter set to 1 tells the library to include the header in the body
68 output. This is only relevant for protocols that actually have headers
69 preceding the data (like HTTP).
70 .IP CURLOPT_NOPROGRESS
71 A parameter set to 1 tells the library to shut off the built-in progress meter
72 completely.
74 Future versions of libcurl are likely to not have any built-in progress meter
75 at all.
76 .IP CURLOPT_NOSIGNAL
77 Pass a long. If it is 1, libcurl will not use any functions that
78 install signal handlers or any functions that cause signals to be sent to the
79 process. This option is mainly here to allow multi-threaded unix applications
80 to still set/use all timeout options etc, without risking getting signals.
81 (Added in 7.10)
83 If this option is set and libcurl has been built with the standard name
84 resolver, timeouts will not occur while the name resolve takes place.
85 Consider building libcurl with c-ares support to enable asynchronous DNS
86 lookups, which enables nice timeouts for name resolves without signals.
87 .IP CURLOPT_WILDCARDMATCH
88 Set this option to 1 if you want to transfer multiple files according to a
89 file name pattern. The pattern can be specified as part of the
90 \fICURLOPT_URL\fP option, using an fnmatch-like pattern (Shell Pattern
91 Matching) in the last part of URL (file name).
93 By default, libcurl uses its internal wildcard matching implementation. You
94 can provide your own matching function by the \fICURLOPT_FNMATCH_FUNCTION\fP
95 option.
97 This feature is only supported by the FTP download for now.
99 A brief introduction of its syntax follows:
101 .IP "\fB*\fP - ASTERISK"
102 \&ftp://example.com/some/path/\fB*.txt\fP (for all txt's from the root
103 directory)
106 .IP "\fB?\fP - QUESTION MARK"
107 Question mark matches any (exactly one) character.
109 \&ftp://example.com/some/path/\fBphoto?.jpeg\fP
112 .IP "\fB[\fP - BRACKET EXPRESSION"
113 The left bracket opens a bracket expression. The question mark and asterisk have
114 no special meaning in a bracket expression. Each bracket expression ends by the
115 right bracket and matches exactly one character. Some examples follow:
117 \fB[a-zA-Z0\-9]\fP or \fB[f\-gF\-G]\fP \- character interval
119 \fB[abc]\fP - character enumeration
121 \fB[^abc]\fP or \fB[!abc]\fP - negation
123 \fB[[:\fP\fIname\fP\fB:]]\fP class expression. Supported classes are
124 \fBalnum\fP,\fBlower\fP, \fBspace\fP, \fBalpha\fP, \fBdigit\fP, \fBprint\fP,
125 \fBupper\fP, \fBblank\fP, \fBgraph\fP, \fBxdigit\fP.
127 \fB[][-!^]\fP - special case \- matches only '\-', ']', '[', '!' or '^'. These
128 characters have no special purpose.
130 \fB[\\[\\]\\\\]\fP - escape syntax. Matches '[', ']' or '\\'.
132 Using the rules above, a file name pattern can be constructed:
134 \&ftp://example.com/some/path/\fB[a-z[:upper:]\\\\].jpeg\fP
137 (This was added in 7.21.0)
138 .SH CALLBACK OPTIONS
139 .IP CURLOPT_WRITEFUNCTION
140 Function pointer that should match the following prototype: \fBsize_t
141 function( void *ptr, size_t size, size_t nmemb, void *userdata);\fP This
142 function gets called by libcurl as soon as there is data received that needs
143 to be saved. The size of the data pointed to by \fIptr\fP is \fIsize\fP
144 multiplied with \fInmemb\fP, it will not be zero terminated. Return the number
145 of bytes actually taken care of. If that amount differs from the amount passed
146 to your function, it'll signal an error to the library. This will abort the
147 transfer and return \fICURLE_WRITE_ERROR\fP.
149 From 7.18.0, the function can return CURL_WRITEFUNC_PAUSE which then will
150 cause writing to this connection to become paused. See
151 \fIcurl_easy_pause(3)\fP for further details.
153 This function may be called with zero bytes data if the transferred file is
154 empty.
156 Set this option to NULL to get the internal default function. The internal
157 default function will write the data to the FILE * given with
158 \fICURLOPT_WRITEDATA\fP.
160 Set the \fIuserdata\fP argument with the \fICURLOPT_WRITEDATA\fP option.
162 The callback function will be passed as much data as possible in all invokes,
163 but you cannot possibly make any assumptions. It may be one byte, it may be
164 thousands. The maximum amount of data that can be passed to the write callback
165 is defined in the curl.h header file: CURL_MAX_WRITE_SIZE.
166 .IP CURLOPT_WRITEDATA
167 Data pointer to pass to the file write function. If you use the
168 \fICURLOPT_WRITEFUNCTION\fP option, this is the pointer you'll get as
169 input. If you don't use a callback, you must pass a 'FILE *' as libcurl will
170 pass this to fwrite() when writing data.
172 The internal \fICURLOPT_WRITEFUNCTION\fP will write the data to the FILE *
173 given with this option, or to stdout if this option hasn't been set.
175 If you're using libcurl as a win32 DLL, you \fBMUST\fP use the
176 \fICURLOPT_WRITEFUNCTION\fP if you set this option or you will experience
177 crashes.
179 This option is also known with the older name \fICURLOPT_FILE\fP, the name
180 \fICURLOPT_WRITEDATA\fP was introduced in 7.9.7.
181 .IP CURLOPT_READFUNCTION
182 Function pointer that should match the following prototype: \fBsize_t
183 function( void *ptr, size_t size, size_t nmemb, void *userdata);\fP This
184 function gets called by libcurl as soon as it needs to read data in order to
185 send it to the peer. The data area pointed at by the pointer \fIptr\fP may be
186 filled with at most \fIsize\fP multiplied with \fInmemb\fP number of
187 bytes. Your function must return the actual number of bytes that you stored in
188 that memory area. Returning 0 will signal end-of-file to the library and cause
189 it to stop the current transfer.
191 If you stop the current transfer by returning 0 "pre-maturely" (i.e before the
192 server expected it, like when you've said you will upload N bytes and you
193 upload less than N bytes), you may experience that the server "hangs" waiting
194 for the rest of the data that won't come.
196 The read callback may return \fICURL_READFUNC_ABORT\fP to stop the current
197 operation immediately, resulting in a \fICURLE_ABORTED_BY_CALLBACK\fP error
198 code from the transfer (Added in 7.12.1)
200 From 7.18.0, the function can return CURL_READFUNC_PAUSE which then will cause
201 reading from this connection to become paused. See \fIcurl_easy_pause(3)\fP
202 for further details.
204 If you set this callback pointer to NULL, or don't set it at all, the default
205 internal read function will be used. It is doing an fread() on the FILE *
206 userdata set with \fICURLOPT_READDATA\fP.
207 .IP CURLOPT_READDATA
208 Data pointer to pass to the file read function. If you use the
209 \fICURLOPT_READFUNCTION\fP option, this is the pointer you'll get as input. If
210 you don't specify a read callback but instead rely on the default internal
211 read function, this data must be a valid readable FILE *.
213 If you're using libcurl as a win32 DLL, you MUST use a
214 \fICURLOPT_READFUNCTION\fP if you set this option.
216 This option was also known by the older name \fICURLOPT_INFILE\fP, the name
217 \fICURLOPT_READDATA\fP was introduced in 7.9.7.
218 .IP CURLOPT_IOCTLFUNCTION
219 Function pointer that should match the \fIcurl_ioctl_callback\fP prototype
220 found in \fI<curl/curl.h>\fP. This function gets called by libcurl when
221 something special I/O-related needs to be done that the library can't do by
222 itself. For now, rewinding the read data stream is the only action it can
223 request. The rewinding of the read data stream may be necessary when doing a
224 HTTP PUT or POST with a multi-pass authentication method.  (Option added in
225 7.12.3).
227 Use \fICURLOPT_SEEKFUNCTION\fP instead to provide seeking!
228 .IP CURLOPT_IOCTLDATA
229 Pass a pointer that will be untouched by libcurl and passed as the 3rd
230 argument in the ioctl callback set with \fICURLOPT_IOCTLFUNCTION\fP.  (Option
231 added in 7.12.3)
232 .IP CURLOPT_SEEKFUNCTION
233 Function pointer that should match the following prototype: \fIint
234 function(void *instream, curl_off_t offset, int origin);\fP This function gets
235 called by libcurl to seek to a certain position in the input stream and can be
236 used to fast forward a file in a resumed upload (instead of reading all
237 uploaded bytes with the normal read function/callback). It is also called to
238 rewind a stream when doing a HTTP PUT or POST with a multi-pass authentication
239 method. The function shall work like "fseek" or "lseek" and accepted SEEK_SET,
240 SEEK_CUR and SEEK_END as argument for origin, although (in 7.18.0) libcurl
241 only passes SEEK_SET. The callback must return 0 (CURL_SEEKFUNC_OK) on
242 success, 1 (CURL_SEEKFUNC_FAIL) to cause the upload operation to fail or 2
243 (CURL_SEEKFUNC_CANTSEEK) to indicate that while the seek failed, libcurl is
244 free to work around the problem if possible. The latter can sometimes be done
245 by instead reading from the input or similar.
247 If you forward the input arguments directly to "fseek" or "lseek", note that
248 the data type for \fIoffset\fP is not the same as defined for curl_off_t on
249 many systems! (Option added in 7.18.0)
250 .IP CURLOPT_SEEKDATA
251 Data pointer to pass to the file read function. If you use the
252 \fICURLOPT_SEEKFUNCTION\fP option, this is the pointer you'll get as input. If
253 you don't specify a seek callback, NULL is passed. (Option added in 7.18.0)
254 .IP CURLOPT_SOCKOPTFUNCTION
255 Function pointer that should match the \fIcurl_sockopt_callback\fP prototype
256 found in \fI<curl/curl.h>\fP. This function gets called by libcurl after the
257 socket() call but before the connect() call. The callback's \fIpurpose\fP
258 argument identifies the exact purpose for this particular socket, and
259 currently only one value is supported: \fICURLSOCKTYPE_IPCXN\fP for the
260 primary connection (meaning the control connection in the FTP case). Future
261 versions of libcurl may support more purposes. It passes the newly created
262 socket descriptor so additional setsockopt() calls can be done at the user's
263 discretion.  Return 0 (zero) from the callback on success. Return 1 from the
264 callback function to signal an unrecoverable error to the library and it will
265 close the socket and return \fICURLE_COULDNT_CONNECT\fP.  (Option added in
266 7.15.6.)
267 .IP CURLOPT_SOCKOPTDATA
268 Pass a pointer that will be untouched by libcurl and passed as the first
269 argument in the sockopt callback set with \fICURLOPT_SOCKOPTFUNCTION\fP.
270 (Option added in 7.15.6.)
271 .IP CURLOPT_OPENSOCKETFUNCTION
272 Function pointer that should match the \fIcurl_opensocket_callback\fP
273 prototype found in \fI<curl/curl.h>\fP. This function gets called by libcurl
274 instead of the \fIsocket(2)\fP call. The callback's \fIpurpose\fP argument
275 identifies the exact purpose for this particular socket, and currently only
276 one value is supported: \fICURLSOCKTYPE_IPCXN\fP for the primary connection
277 (meaning the control connection in the FTP case). Future versions of libcurl
278 may support more purposes. It passes the resolved peer address as a
279 \fIaddress\fP argument so the callback can modify the address or refuse to
280 connect at all. The callback function should return the socket or
281 \fICURL_SOCKET_BAD\fP in case no connection should be established or any error
282 detected. Any additional \fIsetsockopt(2)\fP calls can be done on the socket
283 at the user's discretion.  \fICURL_SOCKET_BAD\fP return value from the
284 callback function will signal an unrecoverable error to the library and it
285 will return \fICURLE_COULDNT_CONNECT\fP.  This return code can be used for IP
286 address blacklisting.  The default behavior is:
288    return socket(addr->family, addr->socktype, addr->protocol);
290 (Option added in 7.17.1.)
291 .IP CURLOPT_OPENSOCKETDATA
292 Pass a pointer that will be untouched by libcurl and passed as the first
293 argument in the opensocket callback set with \fICURLOPT_OPENSOCKETFUNCTION\fP.
294 (Option added in 7.17.1.)
295 .IP CURLOPT_PROGRESSFUNCTION
296 Function pointer that should match the \fIcurl_progress_callback\fP prototype
297 found in \fI<curl/curl.h>\fP. This function gets called by libcurl instead of
298 its internal equivalent with a frequent interval during operation (roughly
299 once per second or sooner) no matter if data is being transfered or not.
300 Unknown/unused argument values passed to the callback will be set to zero
301 (like if you only download data, the upload size will remain 0). Returning a
302 non-zero value from this callback will cause libcurl to abort the transfer and
303 return \fICURLE_ABORTED_BY_CALLBACK\fP.
305 If you transfer data with the multi interface, this function will not be
306 called during periods of idleness unless you call the appropriate libcurl
307 function that performs transfers.
309 \fICURLOPT_NOPROGRESS\fP must be set to 0 to make this function actually
310 get called.
311 .IP CURLOPT_PROGRESSDATA
312 Pass a pointer that will be untouched by libcurl and passed as the first
313 argument in the progress callback set with \fICURLOPT_PROGRESSFUNCTION\fP.
314 .IP CURLOPT_HEADERFUNCTION
315 Function pointer that should match the following prototype: \fIsize_t
316 function( void *ptr, size_t size, size_t nmemb, void *userdata);\fP. This
317 function gets called by libcurl as soon as it has received header data. The
318 header callback will be called once for each header and only complete header
319 lines are passed on to the callback. Parsing headers should be easy enough
320 using this. The size of the data pointed to by \fIptr\fP is \fIsize\fP
321 multiplied with \fInmemb\fP. Do not assume that the header line is zero
322 terminated! The pointer named \fIuserdata\fP is the one you set with the
323 \fICURLOPT_WRITEHEADER\fP option. The callback function must return the number
324 of bytes actually taken care of. If that amount differs from the amount passed
325 to your function, it'll signal an error to the library. This will abort the
326 transfer and return \fICURL_WRITE_ERROR\fP.
328 If this option is not set, or if it is set to NULL, but
329 \fICURLOPT_HEADERDATA\fP (\fICURLOPT_WRITEHEADER\fP) is set to anything but
330 NULL, the function used to accept response data will be used instead. That is,
331 it will be the function specified with \fICURLOPT_WRITEFUNCTION\fP, or if it
332 is not specified or NULL - the default, stream-writing function.
334 It's important to note that the callback will be invoked for the headers of
335 all responses received after initiating a request and not just the final
336 response. This includes all responses which occur during authentication
337 negotiation. If you need to operate on only the headers from the final
338 response, you will need to collect headers in the callback yourself and use
339 HTTP status lines, for example, to delimit response boundaries.
341 Since 7.14.1: When a server sends a chunked encoded transfer, it may contain a
342 trailer. That trailer is identical to a HTTP header and if such a trailer is
343 received it is passed to the application using this callback as well. There
344 are several ways to detect it being a trailer and not an ordinary header: 1)
345 it comes after the response-body. 2) it comes after the final header line (CR
346 LF) 3) a Trailer: header among the response-headers mention what header to
347 expect in the trailer.
348 .IP CURLOPT_WRITEHEADER
349 (This option is also known as \fBCURLOPT_HEADERDATA\fP) Pass a pointer to be
350 used to write the header part of the received data to. If you don't use your
351 own callback to take care of the writing, this must be a valid FILE *. See
352 also the \fICURLOPT_HEADERFUNCTION\fP option above on how to set a custom
353 get-all-headers callback.
354 .IP CURLOPT_DEBUGFUNCTION
355 Function pointer that should match the following prototype: \fIint
356 curl_debug_callback (CURL *, curl_infotype, char *, size_t, void *);\fP
357 \fICURLOPT_DEBUGFUNCTION\fP replaces the standard debug function used when
358 \fICURLOPT_VERBOSE \fP is in effect. This callback receives debug information,
359 as specified with the \fBcurl_infotype\fP argument. This function must return
360 0.  The data pointed to by the char * passed to this function WILL NOT be zero
361 terminated, but will be exactly of the size as told by the size_t argument.
363 Available curl_infotype values:
365 .IP CURLINFO_TEXT
366 The data is informational text.
367 .IP CURLINFO_HEADER_IN
368 The data is header (or header-like) data received from the peer.
369 .IP CURLINFO_HEADER_OUT
370 The data is header (or header-like) data sent to the peer.
371 .IP CURLINFO_DATA_IN
372 The data is protocol data received from the peer.
373 .IP CURLINFO_DATA_OUT
374 The data is protocol data sent to the peer.
376 .IP CURLOPT_DEBUGDATA
377 Pass a pointer to whatever you want passed in to your
378 \fICURLOPT_DEBUGFUNCTION\fP in the last void * argument. This pointer is not
379 used by libcurl, it is only passed to the callback.
380 .IP CURLOPT_SSL_CTX_FUNCTION
381 This option does only function for libcurl powered by OpenSSL. If libcurl was
382 built against another SSL library, this functionality is absent.
384 Function pointer that should match the following prototype: \fBCURLcode
385 sslctxfun(CURL *curl, void *sslctx, void *parm);\fP This function gets called
386 by libcurl just before the initialization of an SSL connection after having
387 processed all other SSL related options to give a last chance to an
388 application to modify the behaviour of openssl's ssl initialization. The
389 \fIsslctx\fP parameter is actually a pointer to an openssl \fISSL_CTX\fP. If
390 an error is returned no attempt to establish a connection is made and the
391 perform operation will return the error code from this callback function.  Set
392 the \fIparm\fP argument with the \fICURLOPT_SSL_CTX_DATA\fP option. This
393 option was introduced in 7.11.0.
395 This function will get called on all new connections made to a server, during
396 the SSL negotiation. The SSL_CTX pointer will be a new one every time.
398 To use this properly, a non-trivial amount of knowledge of the openssl
399 libraries is necessary. For example, using this function allows you to use
400 openssl callbacks to add additional validation code for certificates, and even
401 to change the actual URI of an HTTPS request (example used in the lib509 test
402 case).  See also the example section for a replacement of the key, certificate
403 and trust file settings.
404 .IP CURLOPT_SSL_CTX_DATA
405 Data pointer to pass to the ssl context callback set by the option
406 \fICURLOPT_SSL_CTX_FUNCTION\fP, this is the pointer you'll get as third
407 parameter, otherwise \fBNULL\fP. (Added in 7.11.0)
408 .IP CURLOPT_CONV_TO_NETWORK_FUNCTION
409 .IP CURLOPT_CONV_FROM_NETWORK_FUNCTION
410 .IP CURLOPT_CONV_FROM_UTF8_FUNCTION
411 Function pointers that should match the following prototype: CURLcode
412 function(char *ptr, size_t length);
414 These three options apply to non-ASCII platforms only.  They are available
415 only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was built. When
416 this is the case, \fIcurl_version_info(3)\fP will return the CURL_VERSION_CONV
417 feature bit set.
419 The data to be converted is in a buffer pointed to by the ptr parameter.  The
420 amount of data to convert is indicated by the length parameter.  The converted
421 data overlays the input data in the buffer pointed to by the ptr parameter.
422 CURLE_OK should be returned upon successful conversion.  A CURLcode return
423 value defined by curl.h, such as CURLE_CONV_FAILED, should be returned if an
424 error was encountered.
426 \fBCURLOPT_CONV_TO_NETWORK_FUNCTION\fP and
427 \fBCURLOPT_CONV_FROM_NETWORK_FUNCTION\fP convert between the host encoding and
428 the network encoding.  They are used when commands or ASCII data are
429 sent/received over the network.
431 \fBCURLOPT_CONV_FROM_UTF8_FUNCTION\fP is called to convert from UTF8 into the
432 host encoding.  It is required only for SSL processing.
434 If you set a callback pointer to NULL, or don't set it at all, the built-in
435 libcurl iconv functions will be used.  If HAVE_ICONV was not defined when
436 libcurl was built, and no callback has been established, conversion will
437 return the CURLE_CONV_REQD error code.
439 If HAVE_ICONV is defined, CURL_ICONV_CODESET_OF_HOST must also be defined.
440 For example:
442  \&#define CURL_ICONV_CODESET_OF_HOST "IBM-1047"
444 The iconv code in libcurl will default the network and UTF8 codeset names as
445 follows:
447  \&#define CURL_ICONV_CODESET_OF_NETWORK "ISO8859-1"
449  \&#define CURL_ICONV_CODESET_FOR_UTF8   "UTF-8"
451 You will need to override these definitions if they are different on your
452 system.
453 .IP CURLOPT_INTERLEAVEFUNCTION
454 Function pointer that should match the following prototype: \fIsize_t
455 function( void *ptr, size_t size, size_t nmemb, void *userdata)\fP. This
456 function gets called by libcurl as soon as it has received interleaved RTP
457 data. This function gets called for each $ block and therefore contains
458 exactly one upper-layer protocol unit (e.g.  one RTP packet). Curl writes the
459 interleaved header as well as the included data for each call. The first byte
460 is always an ASCII dollar sign. The dollar sign is followed by a one byte
461 channel identifier and then a 2 byte integer length in network byte order. See
462 \fIRFC 2326 Section 10.12\fP for more information on how RTP interleaving
463 behaves. If unset or set to NULL, curl will use the default write function.
465 Interleaved RTP poses some challeneges for the client application. Since the
466 stream data is sharing the RTSP control connection, it is critical to service
467 the RTP in a timely fashion. If the RTP data is not handled quickly,
468 subsequent response processing may become unreasonably delayed and the
469 connection may close. The application may use \fICURL_RTSPREQ_RECEIVE\fP to
470 service RTP data when no requests are desired. If the application makes a
471 request, (e.g.  \fICURL_RTSPREQ_PAUSE\fP) then the response handler will
472 process any pending RTP data before marking the request as finished.  (Added
473 in 7.20.0)
474 .IP CURLOPT_INTERLEAVEDATA
475 This is the userdata pointer that will be passed to
476 \fICURLOPT_INTERLEAVEFUNCTION\fP when interleaved RTP data is received. (Added
477 in 7.20.0)
478 .IP CURLOPT_CHUNK_BGN_FUNCTION
479 Function pointer that should match the following prototype: \fBlong function
480 (const void *transfer_info, void *ptr, int remains)\fP. This function gets
481 called by libcurl before a part of the stream is going to be transferred (if
482 the transfer supports chunks).
484 This callback makes sense only when using the \fICURLOPT_WILDCARDMATCH\fP
485 option for now.
487 The target of transfer_info parameter is a "feature depended" structure. For
488 the FTP wildcard download, the target is curl_fileinfo structure (see
489 \fIcurl/curl.h\fP).  The parameter ptr is a pointer given by
490 \fICURLOPT_CHUNK_DATA\fP. The parameter remains contains number of chunks
491 remaining per the transfer. If the feature is not available, the parameter has
492 zero value.
494 Return \fICURL_CHUNK_BGN_FUNC_OK\fP if everything is fine,
495 \fICURL_CHUNK_BGN_FUNC_SKIP\fP if you want to skip the concrete chunk or
496 \fICURL_CHUNK_BGN_FUNC_FAIL\fP to tell libcurl to stop if some error occurred.
497 (This was added in 7.21.0)
498 .IP CURLOPT_CHUNK_END_FUNCTION
499 Function pointer that should match the following prototype: \fBlong
500 function(void *ptr)\fP. This function gets called by libcurl as soon as a part
501 of the stream has been transferred (or skipped).
503 Return \fICURL_CHUNK_END_FUNC_OK\fP if everything is fine or
504 \fBCURL_CHUNK_END_FUNC_FAIL\fP to tell the lib to stop if some error occurred.
505 (This was added in 7.21.0)
506 .IP CURLOPT_CHUNK_DATA
507 Pass a pointer that will be untouched by libcurl and passed as the ptr
508 argument to the \fICURL_CHUNK_BGN_FUNTION\fP and \fICURL_CHUNK_END_FUNTION\fP.
509 (This was added in 7.21.0)
510 .IP CURLOPT_FNMATCH_FUNCTION
511 Function pointer that should match \fBint function(void *ptr, const char
512 *pattern, const char *string)\fP prototype (see \fIcurl/curl.h\fP). It is used
513 internally for the wildcard matching feature.
515 Return \fICURL_FNMATCHFUNC_MATCH\fP if pattern matches the string,
516 \fICURL_FNMATCHFUNC_NOMATCH\fP if not or \fICURL_FNMATCHFUNC_FAIL\fP if an
517 error occurred.  (This was added in 7.21.0)
518 .IP CURLOPT_FNMATCH_DATA
519 Pass a pointer that will be untouched by libcurl and passed as the ptr argument
520 to the \fICURL_FNMATCH_FUNCTION\fP. (This was added in 7.21.0)
521 .SH ERROR OPTIONS
522 .IP CURLOPT_ERRORBUFFER
523 Pass a char * to a buffer that the libcurl may store human readable error
524 messages in. This may be more helpful than just the return code from
525 \fIcurl_easy_perform\fP. The buffer must be at least CURL_ERROR_SIZE big.
526 Although this argument is a 'char *', it does not describe an input string.
527 Therefore the (probably undefined) contents of the buffer is NOT copied
528 by the library. You should keep the associated storage available until
529 libcurl no longer needs it. Failing to do so will cause very odd behavior
530 or even crashes. libcurl will need it until you call \fIcurl_easy_cleanup(3)\fP
531 or you set the same option again to use a different pointer.
533 Use \fICURLOPT_VERBOSE\fP and \fICURLOPT_DEBUGFUNCTION\fP to better
534 debug/trace why errors happen.
536 If the library does not return an error, the buffer may not have been
537 touched. Do not rely on the contents in those cases.
539 .IP CURLOPT_STDERR
540 Pass a FILE * as parameter. Tell libcurl to use this stream instead of stderr
541 when showing the progress meter and displaying \fICURLOPT_VERBOSE\fP data.
542 .IP CURLOPT_FAILONERROR
543 A parameter set to 1 tells the library to fail silently if the HTTP code
544 returned is equal to or larger than 400. The default action would be to return
545 the page normally, ignoring that code.
547 This method is not fail-safe and there are occasions where non-successful
548 response codes will slip through, especially when authentication is involved
549 (response codes 401 and 407).
551 You might get some amounts of headers transferred before this situation is
552 detected, like when a "100-continue" is received as a response to a
553 POST/PUT and a 401 or 407 is received immediately afterwards.
554 .SH NETWORK OPTIONS
555 .IP CURLOPT_URL
556 The actual URL to deal with. The parameter should be a char * to a zero
557 terminated string.
559 If the given URL lacks the protocol part ("http://" or "ftp://" etc), it will
560 attempt to guess which protocol to use based on the given host name. If the
561 given protocol of the set URL is not supported, libcurl will return on error
562 (\fICURLE_UNSUPPORTED_PROTOCOL\fP) when you call \fIcurl_easy_perform(3)\fP or
563 \fIcurl_multi_perform(3)\fP. Use \fIcurl_version_info(3)\fP for detailed info
564 on which protocols are supported.
566 The string given to CURLOPT_URL must be url-encoded and follow RFC 2396
567 (http://curl.haxx.se/rfc/rfc2396.txt).
569 Starting with version 7.20.0, the fragment part of the URI will not be send as
570 part of the path, which was the case previously.
572 \fICURLOPT_URL\fP is the only option that \fBmust\fP be set before
573 \fIcurl_easy_perform(3)\fP is called.
575 \fICURLOPT_PROTOCOLS\fP can be used to limit what protocols libcurl will use
576 for this transfer, independent of what libcurl has been compiled to
577 support. That may be useful if you accept the URL from an external source and
578 want to limit the accessibility.
579 .IP CURLOPT_PROTOCOLS
580 Pass a long that holds a bitmask of CURLPROTO_* defines. If used, this bitmask
581 limits what protocols libcurl may use in the transfer. This allows you to have
582 a libcurl built to support a wide range of protocols but still limit specific
583 transfers to only be allowed to use a subset of them. By default libcurl will
584 accept all protocols it supports. See also
585 \fICURLOPT_REDIR_PROTOCOLS\fP. (Added in 7.19.4)
586 .IP CURLOPT_REDIR_PROTOCOLS
587 Pass a long that holds a bitmask of CURLPROTO_* defines. If used, this bitmask
588 limits what protocols libcurl may use in a transfer that it follows to in a
589 redirect when \fICURLOPT_FOLLOWLOCATION\fP is enabled. This allows you to
590 limit specific transfers to only be allowed to use a subset of protocols in
591 redirections. By default libcurl will allow all protocols except for FILE and
592 SCP. This is a difference compared to pre-7.19.4 versions which
593 unconditionally would follow to all protocols supported. (Added in 7.19.4)
594 .IP CURLOPT_PROXY
595 Set HTTP proxy to use. The parameter should be a char * to a zero terminated
596 string holding the host name or dotted IP address. To specify port number in
597 this string, append :[port] to the end of the host name. The proxy string may
598 be prefixed with [protocol]:// since any such prefix will be ignored. The
599 proxy's port number may optionally be specified with the separate option. If
600 not specified, libcurl will default to using port 1080 for proxies.
601 \fICURLOPT_PROXYPORT\fP.
603 When you tell the library to use an HTTP proxy, libcurl will transparently
604 convert operations to HTTP even if you specify an FTP URL etc. This may have
605 an impact on what other features of the library you can use, such as
606 \fICURLOPT_QUOTE\fP and similar FTP specifics that don't work unless you
607 tunnel through the HTTP proxy. Such tunneling is activated with
608 \fICURLOPT_HTTPPROXYTUNNEL\fP.
610 libcurl respects the environment variables \fBhttp_proxy\fP, \fBftp_proxy\fP,
611 \fBall_proxy\fP etc, if any of those are set. The \fICURLOPT_PROXY\fP option
612 does however override any possibly set environment variables.
614 Setting the proxy string to "" (an empty string) will explicitly disable the
615 use of a proxy, even if there is an environment variable set for it.
617 Since 7.14.1, the proxy host string given in environment variables can be
618 specified the exact same way as the proxy can be set with \fICURLOPT_PROXY\fP,
619 include protocol prefix (http://) and embedded user + password.
620 .IP CURLOPT_PROXYPORT
621 Pass a long with this option to set the proxy port to connect to unless it is
622 specified in the proxy string \fICURLOPT_PROXY\fP.
623 .IP CURLOPT_PROXYTYPE
624 Pass a long with this option to set type of the proxy. Available options for
625 this are \fICURLPROXY_HTTP\fP, \fICURLPROXY_HTTP_1_0\fP (added in 7.19.4),
626 \fICURLPROXY_SOCKS4\fP (added in 7.15.2), \fICURLPROXY_SOCKS5\fP,
627 \fICURLPROXY_SOCKS4A\fP (added in 7.18.0) and \fICURLPROXY_SOCKS5_HOSTNAME\fP
628 (added in 7.18.0). The HTTP type is default. (Added in 7.10)
629 .IP CURLOPT_NOPROXY
630 Pass a pointer to a zero terminated string. The should be a comma- separated
631 list of hosts which do not use a proxy, if one is specified.  The only
632 wildcard is a single * character, which matches all hosts, and effectively
633 disables the proxy. Each name in this list is matched as either a domain which
634 contains the hostname, or the hostname itself. For example, local.com would
635 match local.com, local.com:80, and www.local.com, but not www.notlocal.com.
636 (Added in 7.19.4)
637 .IP CURLOPT_HTTPPROXYTUNNEL
638 Set the parameter to 1 to make the library tunnel all operations through a
639 given HTTP proxy. There is a big difference between using a proxy and to
640 tunnel through it. If you don't know what this means, you probably don't want
641 this tunneling option.
642 .IP CURLOPT_SOCKS5_GSSAPI_SERVICE
643 Pass a char * as parameter to a string holding the name of the service. The
644 default service name for a SOCKS5 server is rcmd/server-fqdn. This option
645 allows you to change it. (Added in 7.19.4)
646 .IP CURLOPT_SOCKS5_GSSAPI_NEC
647 Pass a long set to 1 to enable or 0 to disable. As part of the gssapi
648 negotiation a protection mode is negotiated. The rfc1961 says in section
649 4.3/4.4 it should be protected, but the NEC reference implementation does not.
650 If enabled, this option allows the unprotected exchange of the protection mode
651 negotiation. (Added in 7.19.4).
652 .IP CURLOPT_INTERFACE
653 Pass a char * as parameter. This sets the interface name to use as outgoing
654 network interface. The name can be an interface name, an IP address, or a host
655 name.
656 .IP CURLOPT_LOCALPORT
657 Pass a long. This sets the local port number of the socket used for
658 connection. This can be used in combination with \fICURLOPT_INTERFACE\fP and
659 you are recommended to use \fICURLOPT_LOCALPORTRANGE\fP as well when this is
660 set. Valid port numbers are 1 - 65535. (Added in 7.15.2)
661 .IP CURLOPT_LOCALPORTRANGE
662 Pass a long. This is the number of attempts libcurl should make to find a
663 working local port number. It starts with the given \fICURLOPT_LOCALPORT\fP
664 and adds one to the number for each retry. Setting this to 1 or below will
665 make libcurl do only one try for the exact port number. Port numbers by nature
666 are scarce resources that will be busy at times so setting this value to
667 something too low might cause unnecessary connection setup failures. (Added in
668 7.15.2)
669 .IP CURLOPT_DNS_CACHE_TIMEOUT
670 Pass a long, this sets the timeout in seconds. Name resolves will be kept in
671 memory for this number of seconds. Set to zero to completely disable
672 caching, or set to -1 to make the cached entries remain forever. By default,
673 libcurl caches this info for 60 seconds.
675 The name resolve functions of various libc implementations don't re-read name
676 server information unless explicitly told so (for example, by calling
677 \fIres_init(3)\fP). This may cause libcurl to keep using the older server even
678 if DHCP has updated the server info, and this may look like a DNS cache issue
679 to the casual libcurl-app user.
680 .IP CURLOPT_DNS_USE_GLOBAL_CACHE
681 Pass a long. If the value is 1, it tells curl to use a global DNS cache
682 that will survive between easy handle creations and deletions. This is not
683 thread-safe and this will use a global variable.
685 \fBWARNING:\fP this option is considered obsolete. Stop using it. Switch over
686 to using the share interface instead! See \fICURLOPT_SHARE\fP and
687 \fIcurl_share_init(3)\fP.
688 .IP CURLOPT_BUFFERSIZE
689 Pass a long specifying your preferred size (in bytes) for the receive buffer
690 in libcurl.  The main point of this would be that the write callback gets
691 called more often and with smaller chunks. This is just treated as a request,
692 not an order. You cannot be guaranteed to actually get the given size. (Added
693 in 7.10)
695 This size is by default set as big as possible (CURL_MAX_WRITE_SIZE), so it
696 only makes sense to use this option if you want it smaller.
697 .IP CURLOPT_PORT
698 Pass a long specifying what remote port number to connect to, instead of the
699 one specified in the URL or the default port for the used protocol.
700 .IP CURLOPT_TCP_NODELAY
701 Pass a long specifying whether the TCP_NODELAY option should be set or
702 cleared (1 = set, 0 = clear). The option is cleared by default. This
703 will have no effect after the connection has been established.
705 Setting this option will disable TCP's Nagle algorithm. The purpose of
706 this algorithm is to try to minimize the number of small packets on
707 the network (where "small packets" means TCP segments less than the
708 Maximum Segment Size (MSS) for the network).
710 Maximizing the amount of data sent per TCP segment is good because it
711 amortizes the overhead of the send. However, in some cases (most
712 notably telnet or rlogin) small segments may need to be sent
713 without delay. This is less efficient than sending larger amounts of
714 data at a time, and can contribute to congestion on the network if
715 overdone.
716 .IP CURLOPT_ADDRESS_SCOPE
717 Pass a long specifying the scope_id value to use when connecting to IPv6
718 link-local or site-local addresses. (Added in 7.19.0)
719 .SH NAMES and PASSWORDS OPTIONS (Authentication)
720 .IP CURLOPT_NETRC
721 This parameter controls the preference of libcurl between using user names and
722 passwords from your \fI~/.netrc\fP file, relative to user names and passwords
723 in the URL supplied with \fICURLOPT_URL\fP.
725 libcurl uses a user name (and supplied or prompted password) supplied with
726 \fICURLOPT_USERPWD\fP in preference to any of the options controlled by this
727 parameter.
729 Pass a long, set to one of the values described below.
731 .IP CURL_NETRC_OPTIONAL
732 The use of your \fI~/.netrc\fP file is optional, and information in the URL is
733 to be preferred.  The file will be scanned for the host and user name (to
734 find the password only) or for the host only, to find the first user name and
735 password after that \fImachine\fP, which ever information is not specified in
736 the URL.
738 Undefined values of the option will have this effect.
739 .IP CURL_NETRC_IGNORED
740 The library will ignore the file and use only the information in the URL.
742 This is the default.
743 .IP CURL_NETRC_REQUIRED
744 This value tells the library that use of the file is required, to ignore the
745 information in the URL, and to search the file for the host only.
747 Only machine name, user name and password are taken into account
748 (init macros and similar things aren't supported).
750 libcurl does not verify that the file has the correct properties set (as the
751 standard Unix ftp client does). It should only be readable by user.
752 .IP CURLOPT_NETRC_FILE
753 Pass a char * as parameter, pointing to a zero terminated string containing
754 the full path name to the file you want libcurl to use as .netrc file. If this
755 option is omitted, and \fICURLOPT_NETRC\fP is set, libcurl will attempt to
756 find a .netrc file in the current user's home directory. (Added in 7.10.9)
757 .IP CURLOPT_USERPWD
758 Pass a char * as parameter, which should be [user name]:[password] to use for
759 the connection. Use \fICURLOPT_HTTPAUTH\fP to decide the authentication method.
761 When using NTLM, you can set the domain by prepending it to the user name and
762 separating the domain and name with a forward (/) or backward slash (\\). Like
763 this: "domain/user:password" or "domain\\user:password". Some HTTP servers (on
764 Windows) support this style even for Basic authentication.
766 When using HTTP and \fICURLOPT_FOLLOWLOCATION\fP, libcurl might perform
767 several requests to possibly different hosts. libcurl will only send this user
768 and password information to hosts using the initial host name (unless
769 \fICURLOPT_UNRESTRICTED_AUTH\fP is set), so if libcurl follows locations to
770 other hosts it will not send the user and password to those. This is enforced
771 to prevent accidental information leakage.
772 .IP CURLOPT_PROXYUSERPWD
773 Pass a char * as parameter, which should be [user name]:[password] to use for
774 the connection to the HTTP proxy.  Use \fICURLOPT_PROXYAUTH\fP to decide
775 the authentication method.
776 .IP CURLOPT_USERNAME
777 Pass a char * as parameter, which should be pointing to the zero terminated
778 user name to use for the transfer.
780 \fBCURLOPT_USERNAME\fP sets the user name to be used in protocol
781 authentication. You should not use this option together with the (older)
782 CURLOPT_USERPWD option.
784 In order to specify the password to be used in conjunction with the user name
785 use the \fICURLOPT_PASSWORD\fP option.  (Added in 7.19.1)
786 .IP CURLOPT_PASSWORD
787 Pass a char * as parameter, which should be pointing to the zero terminated
788 password to use for the transfer.
790 The CURLOPT_PASSWORD option should be used in conjunction with
791 the \fICURLOPT_USERNAME\fP option. (Added in 7.19.1)
792 .IP CURLOPT_PROXYUSERNAME
793 Pass a char * as parameter, which should be pointing to the zero terminated
794 user name to use for the transfer while connecting to Proxy.
796 The CURLOPT_PROXYUSERNAME option should be used in same way as the
797 \fICURLOPT_PROXYUSERPWD\fP is used.  In comparison to
798 \fICURLOPT_PROXYUSERPWD\fP the CURLOPT_PROXYUSERNAME allows the username to
799 contain a colon, like in the following example: "sip:user@example.com". The
800 CURLOPT_PROXYUSERNAME option is an alternative way to set the user name while
801 connecting to Proxy.  There is no meaning to use it together with the
802 \fICURLOPT_PROXYUSERPWD\fP option.
804 In order to specify the password to be used in conjunction with the user name
805 use the \fICURLOPT_PROXYPASSWORD\fP option.  (Added in 7.19.1)
806 .IP CURLOPT_PROXYPASSWORD
807 Pass a char * as parameter, which should be pointing to the zero terminated
808 password to use for the transfer while connecting to Proxy.
810 The CURLOPT_PROXYPASSWORD option should be used in conjunction with
811 the \fICURLOPT_PROXYUSERNAME\fP option. (Added in 7.19.1)
812 .IP CURLOPT_HTTPAUTH
813 Pass a long as parameter, which is set to a bitmask, to tell libcurl which
814 authentication method(s) you want it to use. The available bits are listed
815 below. If more than one bit is set, libcurl will first query the site to see
816 which authentication methods it supports and then pick the best one you allow
817 it to use. For some methods, this will induce an extra network round-trip. Set
818 the actual name and password with the \fICURLOPT_USERPWD\fP option or
819 with the \fICURLOPT_USERNAME\fP and the \fICURLOPT_USERPASSWORD\fP options.
820 (Added in 7.10.6)
822 .IP CURLAUTH_BASIC
823 HTTP Basic authentication. This is the default choice, and the only method
824 that is in wide-spread use and supported virtually everywhere. This sends
825 the user name and password over the network in plain text, easily captured by
826 others.
827 .IP CURLAUTH_DIGEST
828 HTTP Digest authentication.  Digest authentication is defined in RFC2617 and
829 is a more secure way to do authentication over public networks than the
830 regular old-fashioned Basic method.
831 .IP CURLAUTH_DIGEST_IE
832 HTTP Digest authentication with an IE flavor.  Digest authentication is
833 defined in RFC2617 and is a more secure way to do authentication over public
834 networks than the regular old-fashioned Basic method. The IE flavor is simply
835 that libcurl will use a special "quirk" that IE is known to have used before
836 version 7 and that some servers require the client to use. (This define was
837 added in 7.19.3)
838 .IP CURLAUTH_GSSNEGOTIATE
839 HTTP GSS-Negotiate authentication. The GSS-Negotiate (also known as plain
840 \&"Negotiate") method was designed by Microsoft and is used in their web
841 applications. It is primarily meant as a support for Kerberos5 authentication
842 but may also be used along with other authentication methods. For more
843 information see IETF draft draft-brezak-spnego-http-04.txt.
845 You need to build libcurl with a suitable GSS-API library for this to work.
846 .IP CURLAUTH_NTLM
847 HTTP NTLM authentication. A proprietary protocol invented and used by
848 Microsoft. It uses a challenge-response and hash concept similar to Digest, to
849 prevent the password from being eavesdropped.
851 You need to build libcurl with OpenSSL support for this option to work, or
852 build libcurl on Windows.
853 .IP CURLAUTH_ANY
854 This is a convenience macro that sets all bits and thus makes libcurl pick any
855 it finds suitable. libcurl will automatically select the one it finds most
856 secure.
857 .IP CURLAUTH_ANYSAFE
858 This is a convenience macro that sets all bits except Basic and thus makes
859 libcurl pick any it finds suitable. libcurl will automatically select the one
860 it finds most secure.
862 .IP CURLOPT_PROXYAUTH
863 Pass a long as parameter, which is set to a bitmask, to tell libcurl which
864 authentication method(s) you want it to use for your proxy authentication.  If
865 more than one bit is set, libcurl will first query the site to see what
866 authentication methods it supports and then pick the best one you allow it to
867 use. For some methods, this will induce an extra network round-trip. Set the
868 actual name and password with the \fICURLOPT_PROXYUSERPWD\fP option. The
869 bitmask can be constructed by or'ing together the bits listed above for the
870 \fICURLOPT_HTTPAUTH\fP option. As of this writing, only Basic, Digest and NTLM
871 work. (Added in 7.10.7)
872 .SH HTTP OPTIONS
873 .IP CURLOPT_AUTOREFERER
874 Pass a parameter set to 1 to enable this. When enabled, libcurl will
875 automatically set the Referer: field in requests where it follows a Location:
876 redirect.
877 .IP CURLOPT_ENCODING
878 Sets the contents of the Accept-Encoding: header sent in an HTTP request, and
879 enables decoding of a response when a Content-Encoding: header is received.
880 Three encodings are supported: \fIidentity\fP, which does nothing,
881 \fIdeflate\fP which requests the server to compress its response using the
882 zlib algorithm, and \fIgzip\fP which requests the gzip algorithm.  If a
883 zero-length string is set, then an Accept-Encoding: header containing all
884 supported encodings is sent.
886 This is a request, not an order; the server may or may not do it.  This option
887 must be set (to any non-NULL value) or else any unsolicited encoding done by
888 the server is ignored. See the special file lib/README.encoding for details.
889 .IP CURLOPT_FOLLOWLOCATION
890 A parameter set to 1 tells the library to follow any Location: header that the
891 server sends as part of an HTTP header.
893 This means that the library will re-send the same request on the new location
894 and follow new Location: headers all the way until no more such headers are
895 returned. \fICURLOPT_MAXREDIRS\fP can be used to limit the number of redirects
896 libcurl will follow.
898 Since 7.19.4, libcurl can limit what protocols it will automatically
899 follow. The accepted protocols are set with \fICURLOPT_REDIR_PROTOCOLS\fP and
900 it excludes the FILE protocol by default.
901 .IP CURLOPT_UNRESTRICTED_AUTH
902 A parameter set to 1 tells the library it can continue to send authentication
903 (user+password) when following locations, even when hostname changed. This
904 option is meaningful only when setting \fICURLOPT_FOLLOWLOCATION\fP.
905 .IP CURLOPT_MAXREDIRS
906 Pass a long. The set number will be the redirection limit. If that many
907 redirections have been followed, the next redirect will cause an error
908 (\fICURLE_TOO_MANY_REDIRECTS\fP). This option only makes sense if the
909 \fICURLOPT_FOLLOWLOCATION\fP is used at the same time. Added in 7.15.1:
910 Setting the limit to 0 will make libcurl refuse any redirect. Set it to -1 for
911 an infinite number of redirects (which is the default)
912 .IP CURLOPT_POSTREDIR
913 Pass a bitmask to control how libcurl acts on redirects after POSTs that get a
914 301 or 302 response back.  A parameter with bit 0 set (value
915 \fBCURL_REDIR_POST_301\fP) tells the library to respect RFC 2616/10.3.2 and
916 not convert POST requests into GET requests when following a 301
917 redirection. Setting bit 1 (value CURL_REDIR_POST_302) makes libcurl maintain
918 the request method after a 302 redirect. CURL_REDIR_POST_ALL is a convenience
919 define that sets both bits.
921 The non-RFC behaviour is ubiquitous in web browsers, so the library does the
922 conversion by default to maintain consistency. However, a server may require a
923 POST to remain a POST after such a redirection. This option is meaningful only
924 when setting \fICURLOPT_FOLLOWLOCATION\fP.  (Added in 7.17.1) (This option was
925 known as CURLOPT_POST301 up to 7.19.0 as it only supported the 301 way before
926 then)
927 .IP CURLOPT_PUT
928 A parameter set to 1 tells the library to use HTTP PUT to transfer data. The
929 data should be set with \fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE\fP.
931 This option is deprecated and starting with version 7.12.1 you should instead
932 use \fICURLOPT_UPLOAD\fP.
933 .IP CURLOPT_POST
934 A parameter set to 1 tells the library to do a regular HTTP post. This will
935 also make the library use a "Content-Type:
936 application/x-www-form-urlencoded" header. (This is by far the most commonly
937 used POST method).
939 Use one of \fICURLOPT_POSTFIELDS\fP or \fICURLOPT_COPYPOSTFIELDS\fP options to
940 specify what data to post and \fICURLOPT_POSTFIELDSIZE\fP or
941 \fICURLOPT_POSTFIELDSIZE_LARGE\fP to set the data size.
943 Optionally, you can provide data to POST using the \fICURLOPT_READFUNCTION\fP
944 and \fICURLOPT_READDATA\fP options but then you must make sure to not set
945 \fICURLOPT_POSTFIELDS\fP to anything but NULL. When providing data with a
946 callback, you must transmit it using chunked transfer-encoding or you must set
947 the size of the data with the \fICURLOPT_POSTFIELDSIZE\fP or
948 \fICURLOPT_POSTFIELDSIZE_LARGE\fP option. To enable chunked encoding, you
949 simply pass in the appropriate Transfer-Encoding header, see the
950 post-callback.c example.
952 You can override the default POST Content-Type: header by setting your own
953 with \fICURLOPT_HTTPHEADER\fP.
955 Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
956 You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
958 If you use POST to a HTTP 1.1 server, you can send data without knowing the
959 size before starting the POST if you use chunked encoding. You enable this by
960 adding a header like "Transfer-Encoding: chunked" with
961 \fICURLOPT_HTTPHEADER\fP. With HTTP 1.0 or without chunked transfer, you must
962 specify the size in the request.
964 When setting \fICURLOPT_POST\fP to 1, it will automatically set
965 \fICURLOPT_NOBODY\fP to 0 (since 7.14.1).
967 If you issue a POST request and then want to make a HEAD or GET using the same
968 re-used handle, you must explicitly set the new request type using
969 \fICURLOPT_NOBODY\fP or \fICURLOPT_HTTPGET\fP or similar.
970 .IP CURLOPT_POSTFIELDS
971 Pass a void * as parameter, which should be the full data to post in an HTTP
972 POST operation. You must make sure that the data is formatted the way you want
973 the server to receive it. libcurl will not convert or encode it for you. Most
974 web servers will assume this data to be url-encoded.
976 The pointed data are NOT copied by the library: as a consequence, they must
977 be preserved by the calling application until the transfer finishes.
979 This POST is a normal application/x-www-form-urlencoded kind (and libcurl will
980 set that Content-Type by default when this option is used), which is the most
981 commonly used one by HTML forms. See also the \fICURLOPT_POST\fP. Using
982 \fICURLOPT_POSTFIELDS\fP implies \fICURLOPT_POST\fP.
984 If you want to do a zero-byte POST, you need to set
985 \fICURLOPT_POSTFIELDSIZE\fP explicitly to zero, as simply setting
986 \fICURLOPT_POSTFIELDS\fP to NULL or "" just effectively disables the sending
987 of the specified string. libcurl will instead assume that you'll send the POST
988 data using the read callback!
990 Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
991 You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
993 To make multipart/formdata posts (aka RFC2388-posts), check out the
994 \fICURLOPT_HTTPPOST\fP option.
995 .IP CURLOPT_POSTFIELDSIZE
996 If you want to post data to the server without letting libcurl do a strlen()
997 to measure the data size, this option must be used. When this option is used
998 you can post fully binary data, which otherwise is likely to fail. If this
999 size is set to -1, the library will use strlen() to get the size.
1000 .IP CURLOPT_POSTFIELDSIZE_LARGE
1001 Pass a curl_off_t as parameter. Use this to set the size of the
1002 \fICURLOPT_POSTFIELDS\fP data to prevent libcurl from doing strlen() on the
1003 data to figure out the size. This is the large file version of the
1004 \fICURLOPT_POSTFIELDSIZE\fP option. (Added in 7.11.1)
1005 .IP CURLOPT_COPYPOSTFIELDS
1006 Pass a char * as parameter, which should be the full data to post in an HTTP
1007 POST operation. It behaves as the \fICURLOPT_POSTFIELDS\fP option, but the
1008 original data are copied by the library, allowing the application to overwrite
1009 the original data after setting this option.
1011 Because data are copied, care must be taken when using this option in
1012 conjunction with \fICURLOPT_POSTFIELDSIZE\fP or
1013 \fICURLOPT_POSTFIELDSIZE_LARGE\fP: If the size has not been set prior to
1014 \fICURLOPT_COPYPOSTFIELDS\fP, the data are assumed to be a NUL-terminated
1015 string; else the stored size informs the library about the data byte count to
1016 copy. In any case, the size must not be changed after
1017 \fICURLOPT_COPYPOSTFIELDS\fP, unless another \fICURLOPT_POSTFIELDS\fP or
1018 \fICURLOPT_COPYPOSTFIELDS\fP option is issued.
1019 (Added in 7.17.1)
1020 .IP CURLOPT_HTTPPOST
1021 Tells libcurl you want a multipart/formdata HTTP POST to be made and you
1022 instruct what data to pass on to the server.  Pass a pointer to a linked list
1023 of curl_httppost structs as parameter.  The easiest way to create such a
1024 list, is to use \fIcurl_formadd(3)\fP as documented. The data in this list
1025 must remain intact until you close this curl handle again with
1026 \fIcurl_easy_cleanup(3)\fP.
1028 Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
1029 You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
1031 When setting \fICURLOPT_HTTPPOST\fP, it will automatically set
1032 \fICURLOPT_NOBODY\fP to 0 (since 7.14.1).
1033 .IP CURLOPT_REFERER
1034 Pass a pointer to a zero terminated string as parameter. It will be used to
1035 set the Referer: header in the http request sent to the remote server. This
1036 can be used to fool servers or scripts. You can also set any custom header
1037 with \fICURLOPT_HTTPHEADER\fP.
1038 .IP CURLOPT_USERAGENT
1039 Pass a pointer to a zero terminated string as parameter. It will be used to
1040 set the User-Agent: header in the http request sent to the remote server. This
1041 can be used to fool servers or scripts. You can also set any custom header
1042 with \fICURLOPT_HTTPHEADER\fP.
1043 .IP CURLOPT_HTTPHEADER
1044 Pass a pointer to a linked list of HTTP headers to pass to the server in your
1045 HTTP request. The linked list should be a fully valid list of \fBstruct
1046 curl_slist\fP structs properly filled in. Use \fIcurl_slist_append(3)\fP to
1047 create the list and \fIcurl_slist_free_all(3)\fP to clean up an entire
1048 list. If you add a header that is otherwise generated and used by libcurl
1049 internally, your added one will be used instead. If you add a header with no
1050 content as in 'Accept:' (no data on the right side of the colon), the
1051 internally used header will get disabled. Thus, using this option you can add
1052 new headers, replace internal headers and remove internal headers. To add a
1053 header with no content, make the content be two quotes: \&"". The headers
1054 included in the linked list must not be CRLF-terminated, because curl adds
1055 CRLF after each header item. Failure to comply with this will result in
1056 strange bugs because the server will most likely ignore part of the headers
1057 you specified.
1059 The first line in a request (containing the method, usually a GET or POST) is
1060 not a header and cannot be replaced using this option. Only the lines
1061 following the request-line are headers. Adding this method line in this list
1062 of headers will only cause your request to send an invalid header.
1064 Pass a NULL to this to reset back to no custom headers.
1066 The most commonly replaced headers have "shortcuts" in the options
1067 \fICURLOPT_COOKIE\fP, \fICURLOPT_USERAGENT\fP and \fICURLOPT_REFERER\fP.
1068 .IP CURLOPT_HTTP200ALIASES
1069 Pass a pointer to a linked list of aliases to be treated as valid HTTP 200
1070 responses.  Some servers respond with a custom header response line.  For
1071 example, IceCast servers respond with "ICY 200 OK".  By including this string
1072 in your list of aliases, the response will be treated as a valid HTTP header
1073 line such as "HTTP/1.0 200 OK". (Added in 7.10.3)
1075 The linked list should be a fully valid list of struct curl_slist structs, and
1076 be properly filled in.  Use \fIcurl_slist_append(3)\fP to create the list and
1077 \fIcurl_slist_free_all(3)\fP to clean up an entire list.
1079 The alias itself is not parsed for any version strings. Before libcurl 7.16.3,
1080 Libcurl used the value set by option \fICURLOPT_HTTP_VERSION\fP, but starting
1081 with 7.16.3 the protocol is assumed to match HTTP 1.0 when an alias matched.
1082 .IP CURLOPT_COOKIE
1083 Pass a pointer to a zero terminated string as parameter. It will be used to
1084 set a cookie in the http request. The format of the string should be
1085 NAME=CONTENTS, where NAME is the cookie name and CONTENTS is what the cookie
1086 should contain.
1088 If you need to set multiple cookies, you need to set them all using a single
1089 option and thus you need to concatenate them all in one single string. Set
1090 multiple cookies in one string like this: "name1=content1; name2=content2;"
1091 etc.
1093 This option sets the cookie header explictly in the outgoing request(s). If
1094 multiple requests are done due to authentication, followed redirections or
1095 similar, they will all get this cookie passed on.
1097 Using this option multiple times will only make the latest string override the
1098 previous ones.
1099 .IP CURLOPT_COOKIEFILE
1100 Pass a pointer to a zero terminated string as parameter. It should contain the
1101 name of your file holding cookie data to read. The cookie data may be in
1102 Netscape / Mozilla cookie data format or just regular HTTP-style headers
1103 dumped to a file.
1105 Given an empty or non-existing file or by passing the empty string (""), this
1106 option will enable cookies for this curl handle, making it understand and
1107 parse received cookies and then use matching cookies in future requests.
1109 If you use this option multiple times, you just add more files to read.
1110 Subsequent files will add more cookies.
1111 .IP CURLOPT_COOKIEJAR
1112 Pass a file name as char *, zero terminated. This will make libcurl write all
1113 internally known cookies to the specified file when \fIcurl_easy_cleanup(3)\fP
1114 is called. If no cookies are known, no file will be created. Specify "-" to
1115 instead have the cookies written to stdout. Using this option also enables
1116 cookies for this session, so if you for example follow a location it will make
1117 matching cookies get sent accordingly.
1119 If the cookie jar file can't be created or written to (when the
1120 \fIcurl_easy_cleanup(3)\fP is called), libcurl will not and cannot report an
1121 error for this. Using \fICURLOPT_VERBOSE\fP or \fICURLOPT_DEBUGFUNCTION\fP
1122 will get a warning to display, but that is the only visible feedback you get
1123 about this possibly lethal situation.
1124 .IP CURLOPT_COOKIESESSION
1125 Pass a long set to 1 to mark this as a new cookie "session". It will force
1126 libcurl to ignore all cookies it is about to load that are "session cookies"
1127 from the previous session. By default, libcurl always stores and loads all
1128 cookies, independent if they are session cookies or not. Session cookies are
1129 cookies without expiry date and they are meant to be alive and existing for
1130 this "session" only.
1131 .IP CURLOPT_COOKIELIST
1132 Pass a char * to a cookie string. Cookie can be either in Netscape / Mozilla
1133 format or just regular HTTP-style header (Set-Cookie: ...) format. If cURL
1134 cookie engine was not enabled it will enable its cookie engine.  Passing a
1135 magic string \&"ALL" will erase all cookies known by cURL. (Added in 7.14.1)
1136 Passing the special string \&"SESS" will only erase all session cookies known
1137 by cURL. (Added in 7.15.4) Passing the special string \&"FLUSH" will write
1138 all cookies known by cURL to the file specified by \fICURLOPT_COOKIEJAR\fP.
1139 (Added in 7.17.1)
1140 .IP CURLOPT_HTTPGET
1141 Pass a long. If the long is 1, this forces the HTTP request to get back
1142 to GET. Usable if a POST, HEAD, PUT, or a custom request has been used
1143 previously using the same curl handle.
1145 When setting \fICURLOPT_HTTPGET\fP to 1, it will automatically set
1146 \fICURLOPT_NOBODY\fP to 0 (since 7.14.1).
1147 .IP CURLOPT_HTTP_VERSION
1148 Pass a long, set to one of the values described below. They force libcurl to
1149 use the specific HTTP versions. This is not sensible to do unless you have a
1150 good reason.
1152 .IP CURL_HTTP_VERSION_NONE
1153 We don't care about what version the library uses. libcurl will use whatever
1154 it thinks fit.
1155 .IP CURL_HTTP_VERSION_1_0
1156 Enforce HTTP 1.0 requests.
1157 .IP CURL_HTTP_VERSION_1_1
1158 Enforce HTTP 1.1 requests.
1160 .IP CURLOPT_IGNORE_CONTENT_LENGTH
1161 Ignore the Content-Length header. This is useful for Apache 1.x (and similar
1162 servers) which will report incorrect content length for files over 2
1163 gigabytes. If this option is used, curl will not be able to accurately report
1164 progress, and will simply stop the download when the server ends the
1165 connection. (added in 7.14.1)
1166 .IP CURLOPT_HTTP_CONTENT_DECODING
1167 Pass a long to tell libcurl how to act on content decoding. If set to zero,
1168 content decoding will be disabled. If set to 1 it is enabled. Libcurl has no
1169 default content decoding but requires you to use \fICURLOPT_ENCODING\fP for
1170 that. (added in 7.16.2)
1171 .IP CURLOPT_HTTP_TRANSFER_DECODING
1172 Pass a long to tell libcurl how to act on transfer decoding. If set to zero,
1173 transfer decoding will be disabled, if set to 1 it is enabled
1174 (default). libcurl does chunked transfer decoding by default unless this
1175 option is set to zero. (added in 7.16.2)
1176 .SH SMTP OPTIONS
1177 .IP CURLOPT_MAIL_FROM
1178 Pass a pointer to a zero terminated string as parameter. It will be used to
1179 specify the sender address in a mail when sending an SMTP mail with libcurl.
1181 (Added in 7.20.0)
1182 .IP CURLOPT_MAIL_RCPT
1183 Pass a pointer to a linked list of recipients to pass to the server in your
1184 SMTP mail request.  The linked list should be a fully valid list of \fBstruct
1185 curl_slist\fP structs properly filled in. Use \fIcurl_slist_append(3)\fP to
1186 create the list and \fIcurl_slist_free_all(3)\fP to clean up an entire list.
1188 Each recipient in SMTP lingo is specified with angle brackets (<>), but should
1189 you not use an angle bracket as first letter libcurl will assume you provide a
1190 single email address only and enclose that with angle brackets for you.
1192 (Added in 7.20.0)
1193 .SH TFTP OPTIONS
1194 .IP CURLOPT_TFTP_BLKSIZE
1195 Specify block size to use for TFTP data transmission. Valid range as per RFC
1196 2348 is 8-65464 bytes. The default of 512 bytes will be used if this option is
1197 not specified. The specified block size will only be used pending support by
1198 the remote server. If the server does not return an option acknowledgement or
1199 returns an option acknowledgement with no blksize, the default of 512 bytes
1200 will be used. (added in 7.19.4)
1201 .SH FTP OPTIONS
1202 .IP CURLOPT_FTPPORT
1203 Pass a pointer to a zero terminated string as parameter. It will be used to
1204 get the IP address to use for the FTP PORT instruction. The PORT instruction
1205 tells the remote server to connect to our specified IP address. The string may
1206 be a plain IP address, a host name, a network interface name (under Unix) or
1207 just a '-' symbol to let the library use your system's default IP
1208 address. Default FTP operations are passive, and thus won't use PORT.
1210 The address can be followed by a ':' to specify a port, optionally followed by
1211 a '-' to specify a port range.  If the port specified is 0, the operating
1212 system will pick a free port.  If a range is provided and all ports in the
1213 range are not available, libcurl will report CURLE_FTP_PORT_FAILED for the
1214 handle.  Invalid port/range settings are ignored.  IPv6 addresses followed by
1215 a port or portrange have to be in brackets.  IPv6 addresses without port/range
1216 specifier can be in brackets.  (added in 7.19.5)
1218 Examples with specified ports:
1221   eth0:0
1222   192.168.1.2:32000-33000
1223   curl.se:32123
1224   [::1]:1234-4567
1227 You disable PORT again and go back to using the passive version by setting
1228 this option to NULL.
1229 .IP CURLOPT_QUOTE
1230 Pass a pointer to a linked list of FTP or SFTP commands to pass to
1231 the server prior to your FTP request. This will be done before any
1232 other commands are issued (even before the CWD command for FTP). The
1233 linked list should be a fully valid list of 'struct curl_slist' structs
1234 properly filled in with text strings. Use \fIcurl_slist_append(3)\fP
1235 to append strings (commands) to the list, and clear the entire list
1236 afterwards with \fIcurl_slist_free_all(3)\fP. Disable this operation
1237 again by setting a NULL to this option.
1238 The set of valid FTP commands depends on the server (see RFC959 for a
1239 list of mandatory commands).
1240 The valid SFTP commands are: chgrp, chmod, chown, ln, mkdir, pwd,
1241 rename, rm, rmdir, symlink (see
1242 .BR curl (1))
1243 (SFTP support added in 7.16.3)
1244 .IP CURLOPT_POSTQUOTE
1245 Pass a pointer to a linked list of FTP or SFTP commands to pass to the server
1246 after your FTP transfer request. The commands will only be run if no error
1247 occurred. The linked list should be a fully valid list of struct curl_slist
1248 structs properly filled in as described for \fICURLOPT_QUOTE\fP. Disable this
1249 operation again by setting a NULL to this option.
1250 .IP CURLOPT_PREQUOTE
1251 Pass a pointer to a linked list of FTP commands to pass to the server after
1252 the transfer type is set. The linked list should be a fully valid list of
1253 struct curl_slist structs properly filled in as described for
1254 \fICURLOPT_QUOTE\fP. Disable this operation again by setting a NULL to this
1255 option. Before version 7.15.6, if you also set \fICURLOPT_NOBODY\fP to 1, this
1256 option didn't work.
1257 .IP CURLOPT_DIRLISTONLY
1258 A parameter set to 1 tells the library to just list the names of files in a
1259 directory, instead of doing a full directory listing that would include file
1260 sizes, dates etc. This works for FTP and SFTP URLs.
1262 This causes an FTP NLST command to be sent on an FTP server.  Beware
1263 that some FTP servers list only files in their response to NLST; they
1264 might not include subdirectories and symbolic links.
1266 (This option was known as CURLOPT_FTPLISTONLY up to 7.16.4)
1267 .IP CURLOPT_APPEND
1268 A parameter set to 1 tells the library to append to the remote file instead of
1269 overwrite it. This is only useful when uploading to an FTP site.
1271 (This option was known as CURLOPT_FTPAPPEND up to 7.16.4)
1272 .IP CURLOPT_FTP_USE_EPRT
1273 Pass a long. If the value is 1, it tells curl to use the EPRT (and
1274 LPRT) command when doing active FTP downloads (which is enabled by
1275 \fICURLOPT_FTPPORT\fP). Using EPRT means that it will first attempt to use
1276 EPRT and then LPRT before using PORT, but if you pass zero to this
1277 option, it will not try using EPRT or LPRT, only plain PORT. (Added in 7.10.5)
1279 If the server is an IPv6 host, this option will have no effect as of 7.12.3.
1280 .IP CURLOPT_FTP_USE_EPSV
1281 Pass a long. If the value is 1, it tells curl to use the EPSV command
1282 when doing passive FTP downloads (which it always does by default). Using EPSV
1283 means that it will first attempt to use EPSV before using PASV, but if you
1284 pass zero to this option, it will not try using EPSV, only plain PASV.
1286 If the server is an IPv6 host, this option will have no effect as of 7.12.3.
1287 .IP CURLOPT_FTP_USE_PRET
1288 Pass a long. If the value is 1, it tells curl to send a PRET command before
1289 PASV (and EPSV). Certain FTP servers, mainly drftpd, require this non-standard
1290 command for directory listings as well as up and downloads in PASV mode. Has
1291 no effect when using the active FTP transfers mode.  (Added in 7.20.0)
1292 .IP CURLOPT_FTP_CREATE_MISSING_DIRS
1293 Pass a long. If the value is 1, curl will attempt to create any remote
1294 directory that it fails to CWD into. CWD is the command that changes working
1295 directory. (Added in 7.10.7)
1297 This setting also applies to SFTP-connections. curl will attempt to create
1298 the remote directory if it can't obtain a handle to the target-location. The
1299 creation will fail if a file of the same name as the directory to create
1300 already exists or lack of permissions prevents creation. (Added in 7.16.3)
1302 Starting with 7.19.4, you can also set this value to 2, which will make
1303 libcurl retry the CWD command again if the subsequent MKD command fails. This
1304 is especially useful if you're doing many simultanoes connections against the
1305 same server and they all have this option enabled, as then CWD may first fail
1306 but then another connection does MKD before this connection and thus MKD fails
1307 but trying CWD works! 7.19.4 also introduced the \fICURLFTP_CREATE_DIR\fP and
1308 \fICURLFTP_CREATE_DIR_RETRY\fP enum names for these arguments.
1310 Before version 7.19.4, libcurl will simply ignore arguments set to 2 and act
1311 as if 1 was selected.
1312 .IP CURLOPT_FTP_RESPONSE_TIMEOUT
1313 Pass a long.  Causes curl to set a timeout period (in seconds) on the amount
1314 of time that the server is allowed to take in order to generate a response
1315 message for a command before the session is considered hung.  While curl is
1316 waiting for a response, this value overrides \fICURLOPT_TIMEOUT\fP. It is
1317 recommended that if used in conjunction with \fICURLOPT_TIMEOUT\fP, you set
1318 \fICURLOPT_FTP_RESPONSE_TIMEOUT\fP to a value smaller than
1319 \fICURLOPT_TIMEOUT\fP.  (Added in 7.10.8)
1320 .IP CURLOPT_FTP_ALTERNATIVE_TO_USER
1321 Pass a char * as parameter, pointing to a string which will be used to
1322 authenticate if the usual FTP "USER user" and "PASS password" negotiation
1323 fails. This is currently only known to be required when connecting to
1324 Tumbleweed's Secure Transport FTPS server using client certificates for
1325 authentication. (Added in 7.15.5)
1326 .IP CURLOPT_FTP_SKIP_PASV_IP
1327 Pass a long. If set to 1, it instructs libcurl to not use the IP address the
1328 server suggests in its 227-response to libcurl's PASV command when libcurl
1329 connects the data connection. Instead libcurl will re-use the same IP address
1330 it already uses for the control connection. But it will use the port number
1331 from the 227-response. (Added in 7.14.2)
1333 This option has no effect if PORT, EPRT or EPSV is used instead of PASV.
1334 .IP CURLOPT_USE_SSL
1335 Pass a long using one of the values from below, to make libcurl use your
1336 desired level of SSL for the FTP transfer. (Added in 7.11.0)
1338 (This option was known as CURLOPT_FTP_SSL up to 7.16.4, and the constants
1339 were known as CURLFTPSSL_*)
1341 .IP CURLUSESSL_NONE
1342 Don't attempt to use SSL.
1343 .IP CURLUSESSL_TRY
1344 Try using SSL, proceed as normal otherwise.
1345 .IP CURLUSESSL_CONTROL
1346 Require SSL for the control connection or fail with \fICURLE_USE_SSL_FAILED\fP.
1347 .IP CURLUSESSL_ALL
1348 Require SSL for all communication or fail with \fICURLE_USE_SSL_FAILED\fP.
1350 .IP CURLOPT_FTPSSLAUTH
1351 Pass a long using one of the values from below, to alter how libcurl issues
1352 \&"AUTH TLS" or "AUTH SSL" when FTP over SSL is activated (see
1353 \fICURLOPT_USE_SSL\fP). (Added in 7.12.2)
1355 .IP CURLFTPAUTH_DEFAULT
1356 Allow libcurl to decide.
1357 .IP CURLFTPAUTH_SSL
1358 Try "AUTH SSL" first, and only if that fails try "AUTH TLS".
1359 .IP CURLFTPAUTH_TLS
1360 Try "AUTH TLS" first, and only if that fails try "AUTH SSL".
1362 .IP CURLOPT_FTP_SSL_CCC
1363 If enabled, this option makes libcurl use CCC (Clear Command Channel). It
1364 shuts down the SSL/TLS layer after authenticating. The rest of the
1365 control channel communication will be unencrypted. This allows NAT routers
1366 to follow the FTP transaction. Pass a long using one of the values below.
1367 (Added in 7.16.1)
1369 .IP CURLFTPSSL_CCC_NONE
1370 Don't attempt to use CCC.
1371 .IP CURLFTPSSL_CCC_PASSIVE
1372 Do not initiate the shutdown, but wait for the server to do it. Do not send
1373 a reply.
1374 .IP CURLFTPSSL_CCC_ACTIVE
1375 Initiate the shutdown and wait for a reply.
1377 .IP CURLOPT_FTP_ACCOUNT
1378 Pass a pointer to a zero-terminated string (or NULL to disable). When an FTP
1379 server asks for "account data" after user name and password has been provided,
1380 this data is sent off using the ACCT command. (Added in 7.13.0)
1381 .IP CURLOPT_FTP_FILEMETHOD
1382 Pass a long that should have one of the following values. This option controls
1383 what method libcurl should use to reach a file on a FTP(S) server. The
1384 argument should be one of the following alternatives:
1386 .IP CURLFTPMETHOD_MULTICWD
1387 libcurl does a single CWD operation for each path part in the given URL. For
1388 deep hierarchies this means many commands. This is how RFC1738 says it
1389 should be done. This is the default but the slowest behavior.
1390 .IP CURLFTPMETHOD_NOCWD
1391 libcurl does no CWD at all. libcurl will do SIZE, RETR, STOR etc and give a
1392 full path to the server for all these commands. This is the fastest behavior.
1393 .IP CURLFTPMETHOD_SINGLECWD
1394 libcurl does one CWD with the full target directory and then operates on the
1395 file \&"normally" (like in the multicwd case). This is somewhat more standards
1396 compliant than 'nocwd' but without the full penalty of 'multicwd'.
1398 (Added in 7.15.1)
1399 .SH RTSP OPTIONS
1400 .IP CURLOPT_RTSP_REQUEST
1401 Tell libcurl what kind of RTSP request to make. Pass one of the following RTSP
1402 enum values. Unless noted otherwise, commands require the Session ID to be
1403 initialized. (Added in 7.20.0)
1405 .IP CURL_RTSPREQ_OPTIONS
1406 Used to retrieve the available methods of the server. The application is
1407 responsbile for parsing and obeying the response. \fB(The session ID is not
1408 needed for this method.)\fP  (Added in 7.20.0)
1409 .IP CURL_RTSPREQ_DESCRIBE
1410 Used to get the low level description of a stream. The application should note
1411 what formats it understands in the \fI'Accept:'\fP header. Unless set
1412 manually, libcurl will automatically fill in \fI'Accept:
1413 application/sdp'\fP. Time-condition headers will be added to Describe requests
1414 if the \fICURLOPT_TIMECONDITION\fP option is active. \fB(The session ID is not
1415 needed for this method)\fP  (Added in 7.20.0)
1416 .IP CURL_RTSPREQ_ANNOUNCE
1417 When sent by a client, this method changes the description of the session. For
1418 example, if a client is using the server to record a meeting, the client can
1419 use Announce to inform the server of all the meta-information about the
1420 session.  ANNOUNCE acts like an HTTP PUT or POST just like
1421 \fICURL_RTSPREQ_SET_PARAMETER\fP (Added in 7.20.0)
1422 .IP CURL_RTSPREQ_SETUP
1423 Setup is used to initialize the transport layer for the session. The
1424 application must set the desired Transport options for a session by using the
1425 \fICURLOPT_RTSP_TRANSPORT\fP option prior to calling setup. If no session ID
1426 is currently set with \fICURLOPT_RTSP_SESSION_ID\fP, libcurl will extract and
1427 use the session ID in the response to this request. \fB(The session ID is not
1428 needed for this method).\fP  (Added in 7.20.0)
1429 .IP CURL_RTSPREQ_PLAY
1430 Send a Play command to the server. Use the \fICURLOPT_RANGE\fP option to
1431 modify the playback time (e.g. 'npt=10-15').  (Added in 7.20.0)
1432 .IP CURL_RTSPREQ_PAUSE
1433 Send a Pause command to the server. Use the \fICURLOPT_RANGE\fP option with a
1434 single value to indicate when the stream should be halted. (e.g. npt='25')
1435 (Added in 7.20.0)
1436 .IP CURL_RTSPREQ_TEARDOWN
1437 This command terminates an RTSP session. Simply closing a connection does not
1438 terminate the RTSP session since it is valid to control an RTSP session over
1439 different connections.  (Added in 7.20.0)
1440 .IP CURL_RTSPREQ_GET_PARAMETER
1441 Retrieve a parameter from the server. By default, libcurl will automatically
1442 include a \fIContent-Type: text/parameters\fP header on all non-empty requests
1443 unless a custom one is set. GET_PARAMETER acts just like an HTTP PUT or POST
1444 (see \fICURL_RTSPREQ_SET_PARAMETER\fP).
1445 Applications wishing to send a heartbeat message (e.g. in the presence of a
1446 server-specified timeout) should send use an empty GET_PARAMETER request.
1447 (Added in 7.20.0)
1448 .IP CURL_RTSPREQ_SET_PARAMETER
1449 Set a parameter on the server. By default, libcurl will automatically include
1450 a \fIContent-Type: text/parameters\fP header unless a custom one is set. The
1451 interaction with SET_PARAMTER is much like an HTTP PUT or POST. An application
1452 may either use \fICURLOPT_UPLOAD\fP with \fICURLOPT_READDATA\fP like an HTTP
1453 PUT, or it may use \fICURLOPT_POSTFIELDS\fP like an HTTP POST. No chunked
1454 transfers are allowed, so the application must set the
1455 \fICURLOPT_INFILESIZE\fP in the former and \fICURLOPT_POSTFIELDSIZE\fP in the
1456 latter. Also, there is no use of multi-part POSTs within RTSP. (Added in
1457 7.20.0)
1458 .IP CURL_RTSPREQ_RECORD
1459 Used to tell the server to record a session. Use the \fICURLOPT_RANGE\fP
1460 option to modify the record time. (Added in 7.20.0)
1461 .IP CURL_RTSPREQ_RECEIVE
1462 This is a special request because it does not send any data to the server. The
1463 application may call this function in order to receive interleaved RTP
1464 data. It will return after processing one read buffer of data in order to give
1465 the application a chance to run. (Added in 7.20.0)
1467 .IP CURLOPT_RTSP_SESSION_ID
1468 Pass a char * as a parameter to set the value of the current RTSP Session ID
1469 for the handle. Useful for resuming an in-progress session. Once this value is
1470 set to any non-NULL value, libcurl will return \fICURLE_RTSP_SESSION_ERROR\fP
1471 if ID received from the server does not match. If unset (or set to NULL),
1472 libcurl will automatically set the ID the first time the server sets it in a
1473 response. (Added in 7.20.0)
1474 .IP CURLOPT_RTSP_STREAM_URI
1475 Set the stream URI to operate on by passing a char * . For example, a single
1476 session may be controlling \fIrtsp://foo/twister/audio\fP and
1477 \fIrtsp://foo/twister/video\fP and the application can switch to the
1478 appropriate stream using this option. If unset, libcurl will default to
1479 operating on generic server options by passing '*' in the place of the RTSP
1480 Stream URI. This option is distinct from \fICURLOPT_URL\fP. When working with
1481 RTSP, the \fICURLOPT_STREAM_URI\fP indicates what URL to send to the server in
1482 the request header while the \fICURLOPT_URL\fP indicates where to make the
1483 connection to.  (e.g. the \fICURLOPT_URL\fP for the above examples might be
1484 set to \fIrtsp://foo/twister\fP (Added in 7.20.0)
1485 .IP CURLOPT_RTSP_TRANSPORT
1486 Pass a char * to tell libcurl what to pass for the Transport: header for this
1487 RTSP session. This is mainly a convenience method to avoid needing to set a
1488 custom Transport: header for every SETUP request. The application must set a
1489 Transport: header before issuing a SETUP request. (Added in 7.20.0)
1490 .IP CURLOPT_RTSP_HEADER
1491 This option is simply an alias for \fICURLOPT_HTTP_HEADER\fP. Use this to
1492 replace the standard headers that RTSP and HTTP share. It is also valid to use
1493 the shortcuts such as \fICURLOPT_USERAGENT\fP. (Added in 7.20.0)
1494 .IP CURLOPT_RTSP_CLIENT_CSEQ
1495 Manually set the the CSEQ number to issue for the next RTSP request. Useful if
1496 the application is resuming a previously broken connection. The CSEQ will
1497 increment from this new number henceforth. (Added in 7.20.0)
1498 .IP CURLOPT_RTSP_SERVER_CSEQ
1499 Manually set the CSEQ number to expect for the next RTSP Server->Client
1500 request.  At the moment, this feature (listening for Server requests) is
1501 unimplemented. (Added in 7.20.0)
1502 .SH PROTOCOL OPTIONS
1503 .IP CURLOPT_TRANSFERTEXT
1504 A parameter set to 1 tells the library to use ASCII mode for FTP transfers,
1505 instead of the default binary transfer. For win32 systems it does not set the
1506 stdout to binary mode. This option can be usable when transferring text data
1507 between systems with different views on certain characters, such as newlines
1508 or similar.
1510 libcurl does not do a complete ASCII conversion when doing ASCII transfers
1511 over FTP. This is a known limitation/flaw that nobody has rectified. libcurl
1512 simply sets the mode to ASCII and performs a standard transfer.
1513 .IP CURLOPT_PROXY_TRANSFER_MODE
1514 Pass a long. If the value is set to 1 (one), it tells libcurl to set the
1515 transfer mode (binary or ASCII) for FTP transfers done via an HTTP proxy, by
1516 appending ;type=a or ;type=i to the URL. Without this setting, or it being set
1517 to 0 (zero, the default), \fICURLOPT_TRANSFERTEXT\fP has no effect when doing
1518 FTP via a proxy. Beware that not all proxies support this feature.  (Added in
1519 7.18.0)
1520 .IP CURLOPT_CRLF
1521 Convert Unix newlines to CRLF newlines on transfers.
1522 .IP CURLOPT_RANGE
1523 Pass a char * as parameter, which should contain the specified range you
1524 want. It should be in the format "X-Y", where X or Y may be left out. HTTP
1525 transfers also support several intervals, separated with commas as in
1526 \fI"X-Y,N-M"\fP. Using this kind of multiple intervals will cause the HTTP
1527 server to send the response document in pieces (using standard MIME separation
1528 techniques). For RTSP, the formatting of a range should follow RFC 2326
1529 Section 12.29. For RTSP, byte ranges are \fBnot\fP permitted. Instead, ranges
1530 should be given in npt, utc, or smpte formats.
1532 Pass a NULL to this option to disable the use of ranges.
1534 Ranges work on HTTP, FTP, FILE (since 7.18.0), and RTSP (since 7.20.0)
1535 transfers only.
1536 .IP CURLOPT_RESUME_FROM
1537 Pass a long as parameter. It contains the offset in number of bytes that you
1538 want the transfer to start from. Set this option to 0 to make the transfer
1539 start from the beginning (effectively disabling resume). For FTP, set this
1540 option to -1 to make the transfer start from the end of the target file
1541 (useful to continue an interrupted upload).
1542 .IP CURLOPT_RESUME_FROM_LARGE
1543 Pass a curl_off_t as parameter. It contains the offset in number of bytes that
1544 you want the transfer to start from. (Added in 7.11.0)
1545 .IP CURLOPT_CUSTOMREQUEST
1546 Pass a pointer to a zero terminated string as parameter. It will be used
1547 instead of GET or HEAD when doing an HTTP request, or instead of LIST or NLST
1548 when doing a FTP directory listing. This is useful for doing DELETE or other
1549 more or less obscure HTTP requests. Don't do this at will, make sure your
1550 server supports the command first.
1552 When you change the request method by setting \fBCURLOPT_CUSTOMREQUEST\fP to
1553 something, you don't actually change how libcurl behaves or acts in regards to
1554 the particular request method, it will only change the actual string sent in
1555 the request.
1557 For example: if you tell libcurl to do a HEAD request, but then change the
1558 request to a "GET" with \fBCURLOPT_CUSTOMREQUEST\fP you'll still see libcurl
1559 act as if it sent a HEAD even when it does send a GET.
1561 To switch to a proper HEAD, use \fICURLOPT_NOBODY\fP, to switch to a proper
1562 POST, use \fICURLOPT_POST\fP or \fICURLOPT_POSTFIELDS\fP and so on.
1564 Restore to the internal default by setting this to NULL.
1566 Many people have wrongly used this option to replace the entire request with
1567 their own, including multiple headers and POST contents. While that might work
1568 in many cases, it will cause libcurl to send invalid requests and it could
1569 possibly confuse the remote server badly. Use \fICURLOPT_POST\fP and
1570 \fICURLOPT_POSTFIELDS\fP to set POST data. Use \fICURLOPT_HTTPHEADER\fP to
1571 replace or extend the set of headers sent by libcurl. Use
1572 \fICURLOPT_HTTP_VERSION\fP to change HTTP version.
1573 .IP CURLOPT_FILETIME
1574 Pass a long. If it is 1, libcurl will attempt to get the modification date of
1575 the remote document in this operation. This requires that the remote server
1576 sends the time or replies to a time querying command. The
1577 \fIcurl_easy_getinfo(3)\fP function with the \fICURLINFO_FILETIME\fP argument
1578 can be used after a transfer to extract the received time (if any).
1579 .IP CURLOPT_NOBODY
1580 A parameter set to 1 tells the library to not include the body-part in the
1581 output. This is only relevant for protocols that have separate header and body
1582 parts. On HTTP(S) servers, this will make libcurl do a HEAD request.
1584 To change request to GET, you should use \fICURLOPT_HTTPGET\fP. Change request
1585 to POST with \fICURLOPT_POST\fP etc.
1586 .IP CURLOPT_INFILESIZE
1587 When uploading a file to a remote site, this option should be used to tell
1588 libcurl what the expected size of the infile is. This value should be passed
1589 as a long. See also \fICURLOPT_INFILESIZE_LARGE\fP.
1591 For uploading using SCP, this option or \fICURLOPT_INFILESIZE_LARGE\fP is
1592 mandatory.
1594 This option does not limit how much data libcurl will actually send, as that
1595 is controlled entirely by what the read callback returns.
1596 .IP CURLOPT_INFILESIZE_LARGE
1597 When uploading a file to a remote site, this option should be used to tell
1598 libcurl what the expected size of the infile is.  This value should be passed
1599 as a curl_off_t. (Added in 7.11.0)
1601 For uploading using SCP, this option or \fICURLOPT_INFILESIZE\fP is mandatory.
1603 This option does not limit how much data libcurl will actually send, as that
1604 is controlled entirely by what the read callback returns.
1605 .IP CURLOPT_UPLOAD
1606 A parameter set to 1 tells the library to prepare for an upload. The
1607 \fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE\fP or
1608 \fICURLOPT_INFILESIZE_LARGE\fP options are also interesting for uploads. If
1609 the protocol is HTTP, uploading means using the PUT request unless you tell
1610 libcurl otherwise.
1612 Using PUT with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
1613 You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
1615 If you use PUT to a HTTP 1.1 server, you can upload data without knowing the
1616 size before starting the transfer if you use chunked encoding. You enable this
1617 by adding a header like "Transfer-Encoding: chunked" with
1618 \fICURLOPT_HTTPHEADER\fP. With HTTP 1.0 or without chunked transfer, you must
1619 specify the size.
1620 .IP CURLOPT_MAXFILESIZE
1621 Pass a long as parameter. This allows you to specify the maximum size (in
1622 bytes) of a file to download. If the file requested is larger than this value,
1623 the transfer will not start and CURLE_FILESIZE_EXCEEDED will be returned.
1625 The file size is not always known prior to download, and for such files this
1626 option has no effect even if the file transfer ends up being larger than this
1627 given limit. This concerns both FTP and HTTP transfers.
1628 .IP CURLOPT_MAXFILESIZE_LARGE
1629 Pass a curl_off_t as parameter. This allows you to specify the maximum size
1630 (in bytes) of a file to download. If the file requested is larger than this
1631 value, the transfer will not start and \fICURLE_FILESIZE_EXCEEDED\fP will be
1632 returned. (Added in 7.11.0)
1634 The file size is not always known prior to download, and for such files this
1635 option has no effect even if the file transfer ends up being larger than this
1636 given limit. This concerns both FTP and HTTP transfers.
1637 .IP CURLOPT_TIMECONDITION
1638 Pass a long as parameter. This defines how the \fICURLOPT_TIMEVALUE\fP time
1639 value is treated. You can set this parameter to \fICURL_TIMECOND_IFMODSINCE\fP
1640 or \fICURL_TIMECOND_IFUNMODSINCE\fP. This feature applies to HTTP, FTP, and
1641 RTSP.
1643 The last modification time of a file is not always known and in such instances
1644 this feature will have no effect even if the given time condition would not
1645 have been met. \fIcurl_easy_getinfo(3)\fP with the
1646 \fICURLINFO_CONDITION_UNMET\fP option can be used after a transfer to learn if
1647 a zero-byte successful "transfer" was due to this condition not matching.
1648 .IP CURLOPT_TIMEVALUE
1649 Pass a long as parameter. This should be the time in seconds since 1 Jan 1970,
1650 and the time will be used in a condition as specified with
1651 \fICURLOPT_TIMECONDITION\fP.
1652 .SH CONNECTION OPTIONS
1653 .IP CURLOPT_TIMEOUT
1654 Pass a long as parameter containing the maximum time in seconds that you allow
1655 the libcurl transfer operation to take. Normally, name lookups can take a
1656 considerable time and limiting operations to less than a few minutes risk
1657 aborting perfectly normal operations. This option will cause curl to use the
1658 SIGALRM to enable time-outing system calls.
1660 In unix-like systems, this might cause signals to be used unless
1661 \fICURLOPT_NOSIGNAL\fP is set.
1662 .IP CURLOPT_TIMEOUT_MS
1663 Like \fICURLOPT_TIMEOUT\fP but takes number of milliseconds instead. If
1664 libcurl is built to use the standard system name resolver, that portion
1665 of the transfer will still use full-second resolution for timeouts with
1666 a minimum timeout allowed of one second.
1667 (Added in 7.16.2)
1668 .IP CURLOPT_LOW_SPEED_LIMIT
1669 Pass a long as parameter. It contains the transfer speed in bytes per second
1670 that the transfer should be below during \fICURLOPT_LOW_SPEED_TIME\fP seconds
1671 for the library to consider it too slow and abort.
1672 .IP CURLOPT_LOW_SPEED_TIME
1673 Pass a long as parameter. It contains the time in seconds that the transfer
1674 should be below the \fICURLOPT_LOW_SPEED_LIMIT\fP for the library to consider
1675 it too slow and abort.
1676 .IP CURLOPT_MAX_SEND_SPEED_LARGE
1677 Pass a curl_off_t as parameter.  If an upload exceeds this speed (counted in
1678 bytes per second) on cumulative average during the transfer, the transfer will
1679 pause to keep the average rate less than or equal to the parameter value.
1680 Defaults to unlimited speed. (Added in 7.15.5)
1681 .IP CURLOPT_MAX_RECV_SPEED_LARGE
1682 Pass a curl_off_t as parameter.  If a download exceeds this speed (counted in
1683 bytes per second) on cumulative average during the transfer, the transfer will
1684 pause to keep the average rate less than or equal to the parameter
1685 value. Defaults to unlimited speed. (Added in 7.15.5)
1686 .IP CURLOPT_MAXCONNECTS
1687 Pass a long. The set number will be the persistent connection cache size. The
1688 set amount will be the maximum amount of simultaneously open connections that
1689 libcurl may cache in this easy handle. Default is 5, and there isn't much
1690 point in changing this value unless you are perfectly aware of how this works
1691 and changes libcurl's behaviour. This concerns connections using any of the
1692 protocols that support persistent connections.
1694 When reaching the maximum limit, curl closes the oldest one in the cache to
1695 prevent increasing the number of open connections.
1697 If you already have performed transfers with this curl handle, setting a
1698 smaller MAXCONNECTS than before may cause open connections to get closed
1699 unnecessarily.
1701 If you add this easy handle to a multi handle, this setting is not
1702 acknowledged, and you must instead use \fIcurl_multi_setopt(3)\fP and the
1703 \fICURLMOPT_MAXCONNECTS\fP option.
1704 .IP CURLOPT_CLOSEPOLICY
1705 (Obsolete) This option does nothing.
1706 .IP CURLOPT_FRESH_CONNECT
1707 Pass a long. Set to 1 to make the next transfer use a new (fresh) connection
1708 by force. If the connection cache is full before this connection, one of the
1709 existing connections will be closed as according to the selected or default
1710 policy. This option should be used with caution and only if you understand
1711 what it does. Set this to 0 to have libcurl attempt re-using an existing
1712 connection (default behavior).
1713 .IP CURLOPT_FORBID_REUSE
1714 Pass a long. Set to 1 to make the next transfer explicitly close the
1715 connection when done. Normally, libcurl keeps all connections alive when done
1716 with one transfer in case a succeeding one follows that can re-use them.
1717 This option should be used with caution and only if you understand what it
1718 does. Set to 0 to have libcurl keep the connection open for possible later
1719 re-use (default behavior).
1720 .IP CURLOPT_CONNECTTIMEOUT
1721 Pass a long. It should contain the maximum time in seconds that you allow the
1722 connection to the server to take.  This only limits the connection phase, once
1723 it has connected, this option is of no more use. Set to zero to disable
1724 connection timeout (it will then only timeout on the system's internal
1725 timeouts). See also the \fICURLOPT_TIMEOUT\fP option.
1727 In unix-like systems, this might cause signals to be used unless
1728 \fICURLOPT_NOSIGNAL\fP is set.
1729 .IP CURLOPT_CONNECTTIMEOUT_MS
1730 Like \fICURLOPT_CONNECTTIMEOUT\fP but takes the number of milliseconds
1731 instead. If libcurl is built to use the standard system name resolver,
1732 that portion of the connect will still use full-second resolution for
1733 timeouts with a minimum timeout allowed of one second.
1734 (Added in 7.16.2)
1735 .IP CURLOPT_IPRESOLVE
1736 Allows an application to select what kind of IP addresses to use when
1737 resolving host names. This is only interesting when using host names that
1738 resolve addresses using more than one version of IP. The allowed values are:
1740 .IP CURL_IPRESOLVE_WHATEVER
1741 Default, resolves addresses to all IP versions that your system allows.
1742 .IP CURL_IPRESOLVE_V4
1743 Resolve to IPv4 addresses.
1744 .IP CURL_IPRESOLVE_V6
1745 Resolve to IPv6 addresses.
1747 .IP CURLOPT_CONNECT_ONLY
1748 Pass a long. If the parameter equals 1, it tells the library to perform all
1749 the required proxy authentication and connection setup, but no data transfer.
1750 This option is useful only on HTTP URLs.
1752 This option is useful with the \fICURLINFO_LASTSOCKET\fP option to
1753 \fIcurl_easy_getinfo(3)\fP. The library can set up the connection and then the
1754 application can obtain the most recently used socket for special data
1755 transfers. (Added in 7.15.2)
1756 .SH SSL and SECURITY OPTIONS
1757 .IP CURLOPT_SSLCERT
1758 Pass a pointer to a zero terminated string as parameter. The string should be
1759 the file name of your certificate. The default format is "PEM" and can be
1760 changed with \fICURLOPT_SSLCERTTYPE\fP.
1762 With NSS this is the nickname of the certificate you wish to authenticate
1763 with.
1764 .IP CURLOPT_SSLCERTTYPE
1765 Pass a pointer to a zero terminated string as parameter. The string should be
1766 the format of your certificate. Supported formats are "PEM" and "DER".  (Added
1767 in 7.9.3)
1768 .IP CURLOPT_SSLKEY
1769 Pass a pointer to a zero terminated string as parameter. The string should be
1770 the file name of your private key. The default format is "PEM" and can be
1771 changed with \fICURLOPT_SSLKEYTYPE\fP.
1772 .IP CURLOPT_SSLKEYTYPE
1773 Pass a pointer to a zero terminated string as parameter. The string should be
1774 the format of your private key. Supported formats are "PEM", "DER" and "ENG".
1776 The format "ENG" enables you to load the private key from a crypto engine. In
1777 this case \fICURLOPT_SSLKEY\fP is used as an identifier passed to the
1778 engine. You have to set the crypto engine with \fICURLOPT_SSLENGINE\fP.
1779 \&"DER" format key file currently does not work because of a bug in OpenSSL.
1780 .IP CURLOPT_KEYPASSWD
1781 Pass a pointer to a zero terminated string as parameter. It will be used as
1782 the password required to use the \fICURLOPT_SSLKEY\fP or
1783 \fICURLOPT_SSH_PRIVATE_KEYFILE\fP private key.
1784 You never needed a pass phrase to load a certificate but you need one to
1785 load your private key.
1787 (This option was known as CURLOPT_SSLKEYPASSWD up to 7.16.4 and
1788 CURLOPT_SSLCERTPASSWD up to 7.9.2)
1789 .IP CURLOPT_SSLENGINE
1790 Pass a pointer to a zero terminated string as parameter. It will be used as
1791 the identifier for the crypto engine you want to use for your private
1792 key.
1794 If the crypto device cannot be loaded, \fICURLE_SSL_ENGINE_NOTFOUND\fP is
1795 returned.
1796 .IP CURLOPT_SSLENGINE_DEFAULT
1797 Sets the actual crypto engine as the default for (asymmetric) crypto
1798 operations.
1800 If the crypto device cannot be set, \fICURLE_SSL_ENGINE_SETFAILED\fP is
1801 returned.
1803 Even though this option doesn't need any parameter, in some configurations
1804 \fIcurl_easy_setopt\fP might be defined as a macro taking exactly three
1805 arguments. Therefore, it's recommended to pass 1 as parameter to this option.
1806 .IP CURLOPT_SSLVERSION
1807 Pass a long as parameter to control what version of SSL/TLS to attempt to use.
1808 The available options are:
1810 .IP CURL_SSLVERSION_DEFAULT
1811 The default action. This will attempt to figure out the remote SSL protocol
1812 version, i.e. either SSLv3 or TLSv1 (but not SSLv2, which became disabled
1813 by default with 7.18.1).
1814 .IP CURL_SSLVERSION_TLSv1
1815 Force TLSv1
1816 .IP CURL_SSLVERSION_SSLv2
1817 Force SSLv2
1818 .IP CURL_SSLVERSION_SSLv3
1819 Force SSLv3
1821 .IP CURLOPT_SSL_VERIFYPEER
1822 Pass a long as parameter.
1824 This option determines whether curl verifies the authenticity of the peer's
1825 certificate. A value of 1 means curl verifies; zero means it doesn't.  The
1826 default is nonzero, but before 7.10, it was zero.
1828 When negotiating an SSL connection, the server sends a certificate indicating
1829 its identity.  Curl verifies whether the certificate is authentic, i.e. that
1830 you can trust that the server is who the certificate says it is.  This trust
1831 is based on a chain of digital signatures, rooted in certification authority
1832 (CA) certificates you supply.  As of 7.10, curl installs a default bundle of
1833 CA certificates and you can specify alternate certificates with the
1834 \fICURLOPT_CAINFO\fP option or the \fICURLOPT_CAPATH\fP option.
1836 When \fICURLOPT_SSL_VERIFYPEER\fP is nonzero, and the verification fails to
1837 prove that the certificate is authentic, the connection fails.  When the
1838 option is zero, the connection succeeds regardless.
1840 Authenticating the certificate is not by itself very useful.  You typically
1841 want to ensure that the server, as authentically identified by its
1842 certificate, is the server you mean to be talking to.  Use
1843 \fICURLOPT_SSL_VERIFYHOST\fP to control that.
1844 .IP CURLOPT_CAINFO
1845 Pass a char * to a zero terminated string naming a file holding one or more
1846 certificates to verify the peer with.  This makes sense only when used in
1847 combination with the \fICURLOPT_SSL_VERIFYPEER\fP option.  If
1848 \fICURLOPT_SSL_VERIFYPEER\fP is zero, \fICURLOPT_CAINFO\fP need not
1849 even indicate an accessible file.
1851 This option is by default set to the system path where libcurl's cacert bundle
1852 is assumed to be stored, as established at build time.
1854 When built against NSS, this is the directory that the NSS certificate
1855 database resides in.
1856 .IP CURLOPT_ISSUERCERT
1857 Pass a char * to a zero terminated string naming a file holding a CA
1858 certificate in PEM format. If the option is set, an additional check against
1859 the peer certificate is performed to verify the issuer is indeed the one
1860 associated with the certificate provided by the option. This additional check
1861 is useful in multi-level PKI where one needs to enforce that the peer
1862 certificate is from a specific branch of the tree.
1864 This option makes sense only when used in combination with the
1865 \fICURLOPT_SSL_VERIFYPEER\fP option. Otherwise, the result of the check is not
1866 considered as failure.
1868 A specific error code (CURLE_SSL_ISSUER_ERROR) is defined with the option,
1869 which is returned if the setup of the SSL/TLS session has failed due to a
1870 mismatch with the issuer of peer certificate (\fICURLOPT_SSL_VERIFYPEER\fP has
1871 to be set too for the check to fail). (Added in 7.19.0)
1872 .IP CURLOPT_CAPATH
1873 Pass a char * to a zero terminated string naming a directory holding multiple
1874 CA certificates to verify the peer with. The certificate directory must be
1875 prepared using the openssl c_rehash utility. This makes sense only when used
1876 in combination with the \fICURLOPT_SSL_VERIFYPEER\fP option.  If
1877 \fICURLOPT_SSL_VERIFYPEER\fP is zero, \fICURLOPT_CAPATH\fP need not even
1878 indicate an accessible path.  The \fICURLOPT_CAPATH\fP function apparently
1879 does not work in Windows due to some limitation in openssl. This option is
1880 OpenSSL-specific and does nothing if libcurl is built to use GnuTLS.
1881 .IP CURLOPT_CRLFILE
1882 Pass a char * to a zero terminated string naming a file with the concatenation
1883 of CRL (in PEM format) to use in the certificate validation that occurs during
1884 the SSL exchange.
1886 When curl is built to use NSS or GnuTLS, there is no way to influence the use
1887 of CRL passed to help in the verification process. When libcurl is built with
1888 OpenSSL support, X509_V_FLAG_CRL_CHECK and X509_V_FLAG_CRL_CHECK_ALL are both
1889 set, requiring CRL check against all the elements of the certificate chain if
1890 a CRL file is passed.
1892 This option makes sense only when used in combination with the
1893 \fICURLOPT_SSL_VERIFYPEER\fP option.
1895 A specific error code (CURLE_SSL_CRL_BADFILE) is defined with the option. It
1896 is returned when the SSL exchange fails because the CRL file cannot be loaded.
1897 A failure in certificate verification due to a revocation information found in
1898 the CRL does not trigger this specific error. (Added in 7.19.0)
1899 .IP CURLOPT_CERTINFO
1900 Pass a long set to 1 to enable libcurl's certificate chain info gatherer. With
1901 this enabled, libcurl (if built with OpenSSL) will extract lots of information
1902 and data about the certificates in the certificate chain used in the SSL
1903 connection. This data is then possible to extract after a transfer using
1904 \fIcurl_easy_getinfo(3)\fP and its option \fICURLINFO_CERTINFO\fP. (Added in
1905 7.19.1)
1906 .IP CURLOPT_RANDOM_FILE
1907 Pass a char * to a zero terminated file name. The file will be used to read
1908 from to seed the random engine for SSL. The more random the specified file is,
1909 the more secure the SSL connection will become.
1910 .IP CURLOPT_EGDSOCKET
1911 Pass a char * to the zero terminated path name to the Entropy Gathering Daemon
1912 socket. It will be used to seed the random engine for SSL.
1913 .IP CURLOPT_SSL_VERIFYHOST
1914 Pass a long as parameter.
1916 This option determines whether libcurl verifies that the server cert is for
1917 the server it is known as.
1919 When negotiating a SSL connection, the server sends a certificate indicating
1920 its identity.
1922 When \fICURLOPT_SSL_VERIFYHOST\fP is 2, that certificate must indicate that
1923 the server is the server to which you meant to connect, or the connection
1924 fails.
1926 Curl considers the server the intended one when the Common Name field or a
1927 Subject Alternate Name field in the certificate matches the host name in the
1928 URL to which you told Curl to connect.
1930 When the value is 1, the certificate must contain a Common Name field, but it
1931 doesn't matter what name it says.  (This is not ordinarily a useful setting).
1933 When the value is 0, the connection succeeds regardless of the names in the
1934 certificate.
1936 The default, since 7.10, is 2.
1938 This option controls checking the server's claimed identity.  The server could
1939 be lying.  To control lying, see \fICURLOPT_SSL_VERIFYPEER\fP.
1940 .IP CURLOPT_SSL_CIPHER_LIST
1941 Pass a char *, pointing to a zero terminated string holding the list of
1942 ciphers to use for the SSL connection. The list must be syntactically correct,
1943 it consists of one or more cipher strings separated by colons. Commas or
1944 spaces are also acceptable separators but colons are normally used, \&!, \&-
1945 and \&+ can be used as operators.
1947 For OpenSSL and GnuTLS valid examples of cipher lists include 'RC4-SHA',
1948 \'SHA1+DES\', 'TLSv1' and 'DEFAULT'. The default list is normally set when you
1949 compile OpenSSL.
1951 You'll find more details about cipher lists on this URL:
1952 \fIhttp://www.openssl.org/docs/apps/ciphers.html\fP
1954 For NSS, valid examples of cipher lists include 'rsa_rc4_128_md5',
1955 \'rsa_aes_128_sha\', etc. With NSS you don't add/remove ciphers. If one uses
1956 this option then all known ciphers are disabled and only those passed in
1957 are enabled.
1959 You'll find more details about the NSS cipher lists on this URL:
1960 \fIhttp://directory.fedora.redhat.com/docs/mod_nss.html#Directives\fP
1962 .IP CURLOPT_SSL_SESSIONID_CACHE
1963 Pass a long set to 0 to disable libcurl's use of SSL session-ID caching. Set
1964 this to 1 to enable it. By default all transfers are done using the
1965 cache. While nothing ever should get hurt by attempting to reuse SSL
1966 session-IDs, there seem to be broken SSL implementations in the wild that may
1967 require you to disable this in order for you to succeed. (Added in 7.16.0)
1968 .IP CURLOPT_KRBLEVEL
1969 Pass a char * as parameter. Set the kerberos security level for FTP; this also
1970 enables kerberos awareness.  This is a string, \&'clear', \&'safe',
1971 \&'confidential' or \&'private'.  If the string is set but doesn't match one
1972 of these, 'private' will be used. Set the string to NULL to disable kerberos
1973 support for FTP.
1975 (This option was known as CURLOPT_KRB4LEVEL up to 7.16.3)
1976 .SH SSH OPTIONS
1977 .IP CURLOPT_SSH_AUTH_TYPES
1978 Pass a long set to a bitmask consisting of one or more of
1979 CURLSSH_AUTH_PUBLICKEY, CURLSSH_AUTH_PASSWORD, CURLSSH_AUTH_HOST,
1980 CURLSSH_AUTH_KEYBOARD. Set CURLSSH_AUTH_ANY to let libcurl pick one.
1981 (Added in 7.16.1)
1982 .IP CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
1983 Pass a char * pointing to a string containing 32 hexadecimal digits. The
1984 string should be the 128 bit MD5 checksum of the remote host's public key, and
1985 libcurl will reject the connection to the host unless the md5sums match. This
1986 option is only for SCP and SFTP transfers. (Added in 7.17.1)
1987 .IP CURLOPT_SSH_PUBLIC_KEYFILE
1988 Pass a char * pointing to a file name for your public key. If not used,
1989 libcurl defaults to using \fB~/.ssh/id_dsa.pub\fP.
1990 (Added in 7.16.1)
1991 .IP CURLOPT_SSH_PRIVATE_KEYFILE
1992 Pass a char * pointing to a file name for your private key. If not used,
1993 libcurl defaults to using \fB~/.ssh/id_dsa\fP.  If the file is
1994 password-protected, set the password with \fICURLOPT_KEYPASSWD\fP. (Added in
1995 7.16.1)
1996 .IP CURLOPT_SSH_KNOWNHOSTS
1997 Pass a pointer to a zero terminated string holding the file name of the
1998 known_host file to use.  The known_hosts file should use the OpenSSH file
1999 format as supported by libssh2. If this file is specified, libcurl will only
2000 accept connections with hosts that are known and present in that file, with a
2001 matching public key. Use \fICURLOPT_SSH_KEYFUNCTION\fP to alter the default
2002 behavior on host and key (mis)matching. (Added in 7.19.6)
2003 .IP CURLOPT_SSH_KEYFUNCTION
2004 Pass a pointer to a curl_sshkeycallback function. It gets called when the
2005 known_host matching has been done, to allow the application to act and decide
2006 for libcurl how to proceed. It gets passed the CURL handle, the key from the
2007 known_hosts file, the key from the remote site, info from libcurl on the
2008 matching status and a custom pointer (set with \fICURLOPT_SSH_KEYDATA\fP). It
2009 MUST return one of the following return codes to tell libcurl how to act:
2011 .IP CURLKHSTAT_FINE_ADD_TO_FILE
2012 The host+key is accepted and libcurl will append it to the known_hosts file
2013 before continuing with the connection. This will also add the host+key combo
2014 to the known_host pool kept in memory if it wasn't already present there. The
2015 adding of data to the file is done by completely replacing the file with a new
2016 copy, so the permissions of the file must allow this.
2017 .IP CURLKHSTAT_FINE
2018 The host+key is accepted libcurl will continue with the connection. This will
2019 also add the host+key combo to the known_host pool kept in memory if it wasn't
2020 already present there.
2021 .IP CURLKHSTAT_REJECT
2022 The host+key is rejected. libcurl will deny the connection to continue and it
2023 will be closed.
2024 .IP CURLKHSTAT_DEFER
2025 The host+key is rejected, but the SSH connection is asked to be kept alive.
2026 This feature could be used when the app wants to somehow return back and act
2027 on the host+key situation and then retry without needing the overhead of
2028 setting it up from scratch again.
2030  (Added in 7.19.6)
2031 .IP CURLOPT_SSH_KEYDATA
2032 Pass a void * as parameter. This pointer will be passed along verbatim to the
2033 callback set with \fICURLOPT_SSH_KEYFUNCTION\fP. (Added in 7.19.6)
2034 .SH OTHER OPTIONS
2035 .IP CURLOPT_PRIVATE
2036 Pass a void * as parameter, pointing to data that should be associated with
2037 this curl handle.  The pointer can subsequently be retrieved using
2038 \fIcurl_easy_getinfo(3)\fP with the CURLINFO_PRIVATE option. libcurl itself
2039 does nothing with this data. (Added in 7.10.3)
2040 .IP CURLOPT_SHARE
2041 Pass a share handle as a parameter. The share handle must have been created by
2042 a previous call to \fIcurl_share_init(3)\fP. Setting this option, will make
2043 this curl handle use the data from the shared handle instead of keeping the
2044 data to itself. This enables several curl handles to share data. If the curl
2045 handles are used simultaneously in multiple threads, you \fBMUST\fP use the
2046 locking methods in the share handle. See \fIcurl_share_setopt(3)\fP for
2047 details.
2049 If you add a share that is set to share cookies, your easy handle will use
2050 that cookie cache and get the cookie engine enabled. If you unshare an object
2051 that was using cookies (or change to another object that doesn't share
2052 cookies), the easy handle will get its cookie engine disabled.
2054 Data that the share object is not set to share will be dealt with the usual
2055 way, as if no share was used.
2056 .IP CURLOPT_NEW_FILE_PERMS
2057 Pass a long as a parameter, containing the value of the permissions that will
2058 be assigned to newly created files on the remote server.  The default value is
2059 \fI0644\fP, but any valid value can be used.  The only protocols that can use
2060 this are \fIsftp://\fP, \fIscp://\fP, and \fIfile://\fP. (Added in 7.16.4)
2061 .IP CURLOPT_NEW_DIRECTORY_PERMS
2062 Pass a long as a parameter, containing the value of the permissions that will
2063 be assigned to newly created directories on the remote server.  The default
2064 value is \fI0755\fP, but any valid value can be used.  The only protocols that
2065 can use this are \fIsftp://\fP, \fIscp://\fP, and \fIfile://\fP.
2066 (Added in 7.16.4)
2067 .SH TELNET OPTIONS
2068 .IP CURLOPT_TELNETOPTIONS
2069 Provide a pointer to a curl_slist with variables to pass to the telnet
2070 negotiations. The variables should be in the format <option=value>. libcurl
2071 supports the options 'TTYPE', 'XDISPLOC' and 'NEW_ENV'. See the TELNET
2072 standard for details.
2073 .SH RETURN VALUE
2074 CURLE_OK (zero) means that the option was set properly, non-zero means an
2075 error occurred as \fI<curl/curl.h>\fP defines. See the \fIlibcurl-errors(3)\fP
2076 man page for the full list with descriptions.
2078 If you try to set an option that libcurl doesn't know about, perhaps because
2079 the library is too old to support it or the option was removed in a recent
2080 version, this function will return \fICURLE_FAILED_INIT\fP.
2081 .SH "SEE ALSO"
2082 .BR curl_easy_init "(3), " curl_easy_cleanup "(3), " curl_easy_reset "(3)"