Add and use expat and curl to enable http://.
[msysgit/historical-msysgit.git] / mingw / share / man / man3 / curl_easy_setopt.3
blobce998711fea2712c3135be6a2f0b63b30ee7626b
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2007, 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 .\" * $Id: curl_easy_setopt.3,v 1.186 2007-07-02 17:22:51 jehousley Exp $
22 .\" **************************************************************************
23 .\"
24 .TH curl_easy_setopt 3 "22 Feb 2007" "libcurl 7.16.2" "libcurl Manual"
25 .SH NAME
26 curl_easy_setopt \- set options for a curl easy handle
27 .SH SYNOPSIS
28 #include <curl/curl.h>
30 CURLcode curl_easy_setopt(CURL *handle, CURLoption option, parameter);
31 .SH DESCRIPTION
32 curl_easy_setopt() is used to tell libcurl how to behave. By using the
33 appropriate options to \fIcurl_easy_setopt\fP, you can change libcurl's
34 behavior.  All options are set with the \fIoption\fP followed by a
35 \fIparameter\fP. That parameter can be a \fBlong\fP, a \fBfunction pointer\fP,
36 an \fBobject pointer\fP or a \fBcurl_off_t\fP, depending on what the specific
37 option expects. Read this manual carefully as bad input values may cause
38 libcurl to behave badly!  You can only set one option in each function call. A
39 typical application uses many curl_easy_setopt() calls in the setup phase.
41 Options set with this function call are valid for all forthcoming transfers
42 performed using this \fIhandle\fP.  The options are not in any way reset
43 between transfers, so if you want subsequent transfers with different options,
44 you must change them between the transfers. You can optionally reset all
45 options back to internal default with \fIcurl_easy_reset(3)\fP.
47 Strings passed to libcurl as 'char *' arguments, will not be copied by the
48 library. Instead you should keep them available until libcurl no longer needs
49 them. Failing to do so will cause very odd behavior or even crashes. libcurl
50 will need them until you call \fIcurl_easy_cleanup(3)\fP or you set the same
51 option again to use a different pointer.
53 The \fIhandle\fP is the return code from a \fIcurl_easy_init(3)\fP or
54 \fIcurl_easy_duphandle(3)\fP call.
55 .SH BEHAVIOR OPTIONS
56 .IP CURLOPT_VERBOSE
57 Set the parameter to non-zero to get the library to display a lot of verbose
58 information about its operations. Very useful for libcurl and/or protocol
59 debugging and understanding. The verbose information will be sent to stderr,
60 or the stream set with \fICURLOPT_STDERR\fP.
62 You hardly ever want this set in production use, you will almost always want
63 this when you debug/report problems. Another neat option for debugging is the
64 \fICURLOPT_DEBUGFUNCTION\fP.
65 .IP CURLOPT_HEADER
66 A non-zero parameter tells the library to include the header in the body
67 output. This is only relevant for protocols that actually have headers
68 preceding the data (like HTTP).
69 .IP CURLOPT_NOPROGRESS
70 A non-zero parameter tells the library to shut off the built-in progress meter
71 completely.
73 Future versions of libcurl is likely to not have any built-in progress meter
74 at all.
75 .IP CURLOPT_NOSIGNAL
76 Pass a long. If it is non-zero, libcurl will not use any functions that
77 install signal handlers or any functions that cause signals to be sent to the
78 process. This option is mainly here to allow multi-threaded unix applications
79 to still set/use all timeout options etc, without risking getting signals.
80 (Added in 7.10)
82 Consider building libcurl with ares support to enable asynchronous DNS
83 lookups. It enables nice timeouts for name resolves without signals.
84 .PP
85 .SH CALLBACK OPTIONS
86 .IP CURLOPT_WRITEFUNCTION
87 Function pointer that should match the following prototype: \fBsize_t
88 function( void *ptr, size_t size, size_t nmemb, void *stream);\fP This
89 function gets called by libcurl as soon as there is data received that needs
90 to be saved. The size of the data pointed to by \fIptr\fP is \fIsize\fP
91 multiplied with \fInmemb\fP, it will not be zero terminated. Return the number
92 of bytes actually taken care of. If that amount differs from the amount passed
93 to your function, it'll signal an error to the library and it will abort the
94 transfer and return \fICURLE_WRITE_ERROR\fP.
96 This function may be called with zero bytes data if the transfered file is
97 empty.
99 Set this option to NULL to get the internal default function. The internal
100 default function will write the data to the FILE * given with
101 \fICURLOPT_WRITEDATA\fP.
103 Set the \fIstream\fP argument with the \fICURLOPT_WRITEDATA\fP option.
105 The callback function will be passed as much data as possible in all invokes,
106 but you cannot possibly make any assumptions. It may be one byte, it may be
107 thousands. The maximum amount of data that can be passed to the write callback
108 is defined in the curl.h header file: CURL_MAX_WRITE_SIZE.
109 .IP CURLOPT_WRITEDATA
110 Data pointer to pass to the file write function. If you use the
111 \fICURLOPT_WRITEFUNCTION\fP option, this is the pointer you'll get as
112 input. If you don't use a callback, you must pass a 'FILE *' as libcurl will
113 pass this to fwrite() when writing data.
115 The internal \fICURLOPT_WRITEFUNCTION\fP will write the data to the FILE *
116 given with this option, or to stdout if this option hasn't been set.
118 If you're using libcurl as a win32 DLL, you \fBMUST\fP use the
119 \fICURLOPT_WRITEFUNCTION\fP if you set this option or you will experience
120 crashes.
122 This option is also known with the older name \fICURLOPT_FILE\fP, the name
123 \fICURLOPT_WRITEDATA\fP was introduced in 7.9.7.
124 .IP CURLOPT_READFUNCTION
125 Function pointer that should match the following prototype: \fBsize_t
126 function( void *ptr, size_t size, size_t nmemb, void *stream);\fP This
127 function gets called by libcurl as soon as it needs to read data in order to
128 send it to the peer. The data area pointed at by the pointer \fIptr\fP may be
129 filled with at most \fIsize\fP multiplied with \fInmemb\fP number of
130 bytes. Your function must return the actual number of bytes that you stored in
131 that memory area. Returning 0 will signal end-of-file to the library and cause
132 it to stop the current transfer.
134 If you stop the current transfer by returning 0 "pre-maturely" (i.e before the
135 server expected it, like when you've told you will upload N bytes and you
136 upload less than N bytes), you may experience that the server "hangs" waiting
137 for the rest of the data that won't come.
139 The read callback may return \fICURL_READFUNC_ABORT\fP to stop the current
140 operation immediately, resulting in a \fICURLE_ABORTED_BY_CALLBACK\fP error
141 code from the transfer (Added in 7.12.1)
143 If you set the callback pointer to NULL, or doesn't set it at all, the default
144 internal read function will be used. It is simply doing an fread() on the FILE
145 * stream set with \fICURLOPT_READDATA\fP.
146 .IP CURLOPT_READDATA
147 Data pointer to pass to the file read function. If you use the
148 \fICURLOPT_READFUNCTION\fP option, this is the pointer you'll get as input. If
149 you don't specify a read callback but instead rely on the default internal
150 read function, this data must be a valid readable FILE *.
152 If you're using libcurl as a win32 DLL, you MUST use a
153 \fICURLOPT_READFUNCTION\fP if you set this option.
155 This option is also known with the older name \fICURLOPT_INFILE\fP, the name
156 \fICURLOPT_READDATA\fP was introduced in 7.9.7.
157 .IP CURLOPT_IOCTLFUNCTION
158 Function pointer that should match the \fIcurl_ioctl_callback\fP prototype
159 found in \fI<curl/curl.h>\fP. This function gets called by libcurl when
160 something special I/O-related needs to be done that the library can't do by
161 itself. For now, rewinding the read data stream is the only action it can
162 request. The rewinding of the read data stream may be necessary when doing a
163 HTTP PUT or POST with a multi-pass authentication method.  (Option added in
164 7.12.3)
165 .IP CURLOPT_IOCTLDATA
166 Pass a pointer that will be untouched by libcurl and passed as the 3rd
167 argument in the ioctl callback set with \fICURLOPT_IOCTLFUNCTION\fP.  (Option
168 added in 7.12.3)
169 .IP CURLOPT_SOCKOPTFUNCTION
170 Function pointer that should match the \fIcurl_sockopt_callback\fP prototype
171 found in \fI<curl/curl.h>\fP. This function gets called by libcurl after the
172 socket() call but before the connect() call. The callback's \fIpurpose\fP
173 argument identifies the exact purpose for this particular socket, and
174 currently only one value is supported: \fICURLSOCKTYPE_IPCXN\fP for the
175 primary connection (meaning the control connection in the FTP case). Future
176 versions of libcurl may support more purposes. It passes the newly created
177 socket descriptor so additional setsockopt() calls can be done at the user's
178 discretion.  A non-zero return code from the callback function will signal an
179 unrecoverable error to the library and it will close the socket and return
180 \fICURLE_COULDNT_CONNECT\fP.  (Option added in 7.15.6.)
181 .IP CURLOPT_SOCKOPTDATA
182 Pass a pointer that will be untouched by libcurl and passed as the first
183 argument in the sockopt callback set with \fICURLOPT_SOCKOPTFUNCTION\fP.
184 (Option added in 7.15.6.)
185 .IP CURLOPT_PROGRESSFUNCTION
186 Function pointer that should match the \fIcurl_progress_callback\fP prototype
187 found in \fI<curl/curl.h>\fP. This function gets called by libcurl instead of
188 its internal equivalent with a frequent interval during operation (roughly
189 once per second) no matter if data is being transfered or not.  Unknown/unused
190 argument values passed to the callback will be set to zero (like if you only
191 download data, the upload size will remain 0). Returning a non-zero value from
192 this callback will cause libcurl to abort the transfer and return
193 \fICURLE_ABORTED_BY_CALLBACK\fP.
195 If you transfer data with the multi interface, this function will not be
196 called during periods of idleness unless you call the appropriate libcurl
197 function that performs transfers. Usage of the \fBCURLOPT_PROGRESSFUNCTION\fP
198 callback is not recommended when using the multi interface.
200 \fICURLOPT_NOPROGRESS\fP must be set to FALSE to make this function actually
201 get called.
202 .IP CURLOPT_PROGRESSDATA
203 Pass a pointer that will be untouched by libcurl and passed as the first
204 argument in the progress callback set with \fICURLOPT_PROGRESSFUNCTION\fP.
205 .IP CURLOPT_HEADERFUNCTION
206 Function pointer that should match the following prototype: \fIsize_t
207 function( void *ptr, size_t size, size_t nmemb, void *stream);\fP. This
208 function gets called by libcurl as soon as it has received header data. The
209 header callback will be called once for each header and only complete header
210 lines are passed on to the callback. Parsing headers should be easy enough
211 using this. The size of the data pointed to by \fIptr\fP is \fIsize\fP
212 multiplied with \fInmemb\fP. Do not assume that the header line is zero
213 terminated! The pointer named \fIstream\fP is the one you set with the
214 \fICURLOPT_WRITEHEADER\fP option. The callback function must return the number
215 of bytes actually taken care of, or return -1 to signal error to the library
216 (it will cause it to abort the transfer with a \fICURLE_WRITE_ERROR\fP return
217 code).
219 Since 7.14.1: When a server sends a chunked encoded transfer, it may contain a
220 trailer. That trailer is identical to a HTTP header and if such a trailer is
221 received it is passed to the application using this callback as well. There
222 are several ways to detect it being a trailer and not an ordinary header: 1)
223 it comes after the response-body. 2) it comes after the final header line (CR
224 LF) 3) a Trailer: header among the response-headers mention what header to
225 expect in the trailer.
226 .IP CURLOPT_WRITEHEADER
227 (This option is also known as \fBCURLOPT_HEADERDATA\fP) Pass a pointer to be
228 used to write the header part of the received data to. If you don't use your
229 own callback to take care of the writing, this must be a valid FILE *. See
230 also the \fICURLOPT_HEADERFUNCTION\fP option above on how to set a custom
231 get-all-headers callback.
232 .IP CURLOPT_DEBUGFUNCTION
233 Function pointer that should match the following prototype: \fIint
234 curl_debug_callback (CURL *, curl_infotype, char *, size_t, void *);\fP
235 \fICURLOPT_DEBUGFUNCTION\fP replaces the standard debug function used when
236 \fICURLOPT_VERBOSE \fP is in effect. This callback receives debug information,
237 as specified with the \fBcurl_infotype\fP argument. This function must return
238 0.  The data pointed to by the char * passed to this function WILL NOT be zero
239 terminated, but will be exactly of the size as told by the size_t argument.
241 Available curl_infotype values:
243 .IP CURLINFO_TEXT
244 The data is informational text.
245 .IP CURLINFO_HEADER_IN
246 The data is header (or header-like) data received from the peer.
247 .IP CURLINFO_HEADER_OUT
248 The data is header (or header-like) data sent to the peer.
249 .IP CURLINFO_DATA_IN
250 The data is protocol data received from the peer.
251 .IP CURLINFO_DATA_OUT
252 The data is protocol data sent to the peer.
254 .IP CURLOPT_DEBUGDATA
255 Pass a pointer to whatever you want passed in to your
256 \fICURLOPT_DEBUGFUNCTION\fP in the last void * argument. This pointer is not
257 used by libcurl, it is only passed to the callback.
258 .IP CURLOPT_SSL_CTX_FUNCTION
259 Function pointer that should match the following prototype: \fBCURLcode
260 sslctxfun(CURL *curl, void *sslctx, void *parm);\fP This function gets called
261 by libcurl just before the initialization of an SSL connection after having
262 processed all other SSL related options to give a last chance to an
263 application to modify the behaviour of openssl's ssl initialization. The
264 \fIsslctx\fP parameter is actually a pointer to an openssl \fISSL_CTX\fP. If
265 an error is returned no attempt to establish a connection is made and the
266 perform operation will return the error code from this callback function.  Set
267 the \fIparm\fP argument with the \fICURLOPT_SSL_CTX_DATA\fP option. This
268 option was introduced in 7.11.0.
270 This function will get called on all new connections made to a server, during
271 the SSL negotiation. The SSL_CTX pointer will be a new one every time.
273 To use this properly, a non-trivial amount of knowledge of the openssl
274 libraries is necessary. Using this function allows for example to use openssl
275 callbacks to add additional validation code for certificates, and even to
276 change the actual URI of an HTTPS request (example used in the lib509 test
277 case).  See also the example section for a replacement of the key, certificate
278 and trust file settings.
279 .IP CURLOPT_SSL_CTX_DATA
280 Data pointer to pass to the ssl context callback set by the option
281 \fICURLOPT_SSL_CTX_FUNCTION\fP, this is the pointer you'll get as third
282 parameter, otherwise \fBNULL\fP. (Added in 7.11.0)
283 .IP CURLOPT_CONV_TO_NETWORK_FUNCTION
284 .IP CURLOPT_CONV_FROM_NETWORK_FUNCTION
285 .IP CURLOPT_CONV_FROM_UTF8_FUNCTION
286 Function pointers that should match the following prototype: CURLcode
287 function(char *ptr, size_t length);
289 These three options apply to non-ASCII platforms only.  They are available
290 only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was built. When
291 this is the case, \fIcurl_version_info(3)\fP will return the CURL_VERSION_CONV
292 feature bit set.
294 The data to be converted is in a buffer pointed to by the ptr parameter.  The
295 amount of data to convert is indicated by the length parameter.  The converted
296 data overlays the input data in the buffer pointed to by the ptr parameter.
297 CURLE_OK should be returned upon successful conversion.  A CURLcode return
298 value defined by curl.h, such as CURLE_CONV_FAILED, should be returned if an
299 error was encountered.
301 \fBCURLOPT_CONV_TO_NETWORK_FUNCTION\fP and
302 \fBCURLOPT_CONV_FROM_NETWORK_FUNCTION\fP convert between the host encoding and
303 the network encoding.  They are used when commands or ASCII data are
304 sent/received over the network.
306 \fBCURLOPT_CONV_FROM_UTF8_FUNCTION\fP is called to convert from UTF8 into the
307 host encoding.  It is required only for SSL processing.
309 If you set a callback pointer to NULL, or don't set it at all, the built-in
310 libcurl iconv functions will be used.  If HAVE_ICONV was not defined when
311 libcurl was built, and no callback has been established, conversion will
312 return the CURLE_CONV_REQD error code.
314 If HAVE_ICONV is defined, CURL_ICONV_CODESET_OF_HOST must also be defined.
315 For example:
317  \&#define CURL_ICONV_CODESET_OF_HOST "IBM-1047"
319 The iconv code in libcurl will default the network and UTF8 codeset names as
320 follows:
322  \&#define CURL_ICONV_CODESET_OF_NETWORK "ISO8859-1"
324  \&#define CURL_ICONV_CODESET_FOR_UTF8   "UTF-8"
326 You will need to override these definitions if they are different on your
327 system.
328 .SH ERROR OPTIONS
329 .IP CURLOPT_ERRORBUFFER
330 Pass a char * to a buffer that the libcurl may store human readable error
331 messages in. This may be more helpful than just the return code from
332 \fIcurl_easy_perform\fP. The buffer must be at least CURL_ERROR_SIZE big.
334 Use \fICURLOPT_VERBOSE\fP and \fICURLOPT_DEBUGFUNCTION\fP to better
335 debug/trace why errors happen.
337 If the library does not return an error, the buffer may not have been
338 touched. Do not rely on the contents in those cases.
340 .IP CURLOPT_STDERR
341 Pass a FILE * as parameter. Tell libcurl to use this stream instead of stderr
342 when showing the progress meter and displaying \fICURLOPT_VERBOSE\fP data.
343 .IP CURLOPT_FAILONERROR
344 A non-zero parameter tells the library to fail silently if the HTTP code
345 returned is equal to or larger than 400. The default action would be to return
346 the page normally, ignoring that code.
348 This method is not fail-safe and there are occasions where non-successful
349 response codes will slip through, especially when authentication is involved
350 (response codes 401 and 407).
352 You might get some amounts of headers transferred before this situation is
353 detected, like for when a "100-continue" is received as a response to a
354 POST/PUT and a 401 or 407 is received immediately afterwards.
355 .SH NETWORK OPTIONS
356 .IP CURLOPT_URL
357 The actual URL to deal with. The parameter should be a char * to a zero
358 terminated string. The string must remain present until curl no longer needs
359 it, as it doesn't copy the string.
361 If the given URL lacks the protocol part ("http://" or "ftp://" etc), it will
362 attempt to guess which protocol to use based on the given host name. If the
363 given protocol of the set URL is not supported, libcurl will return on error
364 (\fICURLE_UNSUPPORTED_PROTOCOL\fP) when you call \fIcurl_easy_perform(3)\fP or
365 \fIcurl_multi_perform(3)\fP. Use \fIcurl_version_info(3)\fP for detailed info
366 on which protocols that are supported.
368 The string given to CURLOPT_URL must be url-encoded and following the RFC 2396
369 (http://curl.haxx.se/rfc/rfc2396.txt).
371 \fICURLOPT_URL\fP is the only option that \fBmust\fP be set before
372 \fIcurl_easy_perform(3)\fP is called.
373 .IP CURLOPT_PROXY
374 Set HTTP proxy to use. The parameter should be a char * to a zero terminated
375 string holding the host name or dotted IP address. To specify port number in
376 this string, append :[port] to the end of the host name. The proxy string may
377 be prefixed with [protocol]:// since any such prefix will be ignored. The
378 proxy's port number may optionally be specified with the separate option
379 \fICURLOPT_PROXYPORT\fP.
381 When you tell the library to use an HTTP proxy, libcurl will transparently
382 convert operations to HTTP even if you specify an FTP URL etc. This may have
383 an impact on what other features of the library you can use, such as
384 \fICURLOPT_QUOTE\fP and similar FTP specifics that don't work unless you
385 tunnel through the HTTP proxy. Such tunneling is activated with
386 \fICURLOPT_HTTPPROXYTUNNEL\fP.
388 libcurl respects the environment variables \fBhttp_proxy\fP, \fBftp_proxy\fP,
389 \fBall_proxy\fP etc, if any of those is set. The \fICURLOPT_PROXY\fP option
390 does however override any possibly set environment variables.
392 Setting the proxy string to "" (an empty string) will explicitly disable the
393 use of a proxy, even if there is an environment variable set for it.
395 Since 7.14.1, the proxy host string given in environment variables can be
396 specified the exact same way as the proxy can be set with \fICURLOPT_PROXY\fP,
397 include protocol prefix (http://) and embedded user + password.
398 .IP CURLOPT_PROXYPORT
399 Pass a long with this option to set the proxy port to connect to unless it is
400 specified in the proxy string \fICURLOPT_PROXY\fP.
401 .IP CURLOPT_PROXYTYPE
402 Pass a long with this option to set type of the proxy. Available options for
403 this are \fICURLPROXY_HTTP\fP, \fICURLPROXY_SOCKS4\fP (added in 7.15.2)
404 \fICURLPROXY_SOCKS5\fP. The HTTP type is default. (Added in 7.10)
405 .IP CURLOPT_HTTPPROXYTUNNEL
406 Set the parameter to non-zero to get the library to tunnel all operations
407 through a given HTTP proxy. There is a big difference between using a proxy
408 and to tunnel through it. If you don't know what this means, you probably
409 don't want this tunneling option.
410 .IP CURLOPT_INTERFACE
411 Pass a char * as parameter. This set the interface name to use as outgoing
412 network interface. The name can be an interface name, an IP address or a host
413 name.
414 .IP CURLOPT_LOCALPORT
415 Pass a long. This sets the local port number of the socket used for
416 connection. This can be used in combination with \fICURLOPT_INTERFACE\fP and
417 you are recommended to use \fICURLOPT_LOCALPORTRANGE\fP as well when this is
418 set. Note that port numbers are only valid 1 - 65535. (Added in 7.15.2)
419 .IP CURLOPT_LOCALPORTRANGE
420 Pass a long. This is the number of attempts libcurl should do to find a
421 working local port number. It starts with the given \fICURLOPT_LOCALPORT\fP
422 and adds one to the number for each retry. Setting this value to 1 or below
423 will make libcurl do only one try for exact port number. Note that port
424 numbers by nature is a scarce resource that will be busy at times so setting
425 this value to something too low might cause unnecessary connection setup
426 failures. (Added in 7.15.2)
427 .IP CURLOPT_DNS_CACHE_TIMEOUT
428 Pass a long, this sets the timeout in seconds. Name resolves will be kept in
429 memory for this number of seconds. Set to zero (0) to completely disable
430 caching, or set to -1 to make the cached entries remain forever. By default,
431 libcurl caches this info for 60 seconds.
432 .IP CURLOPT_DNS_USE_GLOBAL_CACHE
433 Pass a long. If the value is non-zero, it tells curl to use a global DNS cache
434 that will survive between easy handle creations and deletions. This is not
435 thread-safe and this will use a global variable.
437 \fBWARNING:\fP this option is considered obsolete. Stop using it. Switch over
438 to using the share interface instead! See \fICURLOPT_SHARE\fP and
439 \fIcurl_share_init(3)\fP.
440 .IP CURLOPT_BUFFERSIZE
441 Pass a long specifying your preferred size (in bytes) for the receive buffer
442 in libcurl.  The main point of this would be that the write callback gets
443 called more often and with smaller chunks. This is just treated as a request,
444 not an order. You cannot be guaranteed to actually get the given size. (Added
445 in 7.10)
447 This size is by default set as big as possible (CURL_MAX_WRITE_SIZE), so it
448 only makes sense to use this option if you want it smaller.
449 .IP CURLOPT_PORT
450 Pass a long specifying what remote port number to connect to, instead of the
451 one specified in the URL or the default port for the used protocol.
452 .IP CURLOPT_TCP_NODELAY
453 Pass a long specifying whether the TCP_NODELAY option should be set or
454 cleared (1 = set, 0 = clear). The option is cleared by default. This
455 will have no effect after the connection has been established.
457 Setting this option will disable TCP's Nagle algorithm. The purpose of
458 this algorithm is to try to minimize the number of small packets on
459 the network (where "small packets" means TCP segments less than the
460 Maximum Segment Size (MSS) for the network).
462 Maximizing the amount of data sent per TCP segment is good because it
463 amortizes the overhead of the send. However, in some cases (most
464 notably telnet or rlogin) small segments may need to be sent
465 without delay. This is less efficient than sending larger amounts of
466 data at a time, and can contribute to congestion on the network if
467 overdone.
468 .SH NAMES and PASSWORDS OPTIONS (Authentication)
469 .IP CURLOPT_NETRC
470 This parameter controls the preference of libcurl between using user names and
471 passwords from your \fI~/.netrc\fP file, relative to user names and passwords
472 in the URL supplied with \fICURLOPT_URL\fP.
474 libcurl uses a user name (and supplied or prompted password) supplied with
475 \fICURLOPT_USERPWD\fP in preference to any of the options controlled by this
476 parameter.
478 Pass a long, set to one of the values described below.
480 .IP CURL_NETRC_OPTIONAL
481 The use of your \fI~/.netrc\fP file is optional,
482 and information in the URL is to be preferred.  The file will be scanned
483 with the host and user name (to find the password only) or with the host only,
484 to find the first user name and password after that \fImachine\fP,
485 which ever information is not specified in the URL.
487 Undefined values of the option will have this effect.
488 .IP CURL_NETRC_IGNORED
489 The library will ignore the file and use only the information in the URL.
491 This is the default.
492 .IP CURL_NETRC_REQUIRED
493 This value tells the library that use of the file is required,
494 to ignore the information in the URL,
495 and to search the file with the host only.
497 Only machine name, user name and password are taken into account
498 (init macros and similar things aren't supported).
500 libcurl does not verify that the file has the correct properties set (as the
501 standard Unix ftp client does). It should only be readable by user.
502 .IP CURLOPT_NETRC_FILE
503 Pass a char * as parameter, pointing to a zero terminated string containing
504 the full path name to the file you want libcurl to use as .netrc file. If this
505 option is omitted, and \fICURLOPT_NETRC\fP is set, libcurl will attempt to
506 find the a .netrc file in the current user's home directory. (Added in 7.10.9)
507 .IP CURLOPT_USERPWD
508 Pass a char * as parameter, which should be [user name]:[password] to use for
509 the connection. Use \fICURLOPT_HTTPAUTH\fP to decide authentication method.
511 When using NTLM, you can set domain by prepending it to the user name and
512 separating the domain and name with a forward (/) or backward slash (\\). Like
513 this: "domain/user:password" or "domain\\user:password". Some HTTP servers (on
514 Windows) support this style even for Basic authentication.
516 When using HTTP and \fICURLOPT_FOLLOWLOCATION\fP, libcurl might perform
517 several requests to possibly different hosts. libcurl will only send this user
518 and password information to hosts using the initial host name (unless
519 \fICURLOPT_UNRESTRICTED_AUTH\fP is set), so if libcurl follows locations to
520 other hosts it will not send the user and password to those. This is enforced
521 to prevent accidental information leakage.
522 .IP CURLOPT_PROXYUSERPWD
523 Pass a char * as parameter, which should be [user name]:[password] to use for
524 the connection to the HTTP proxy.  Use \fICURLOPT_PROXYAUTH\fP to decide
525 authentication method.
526 .IP CURLOPT_HTTPAUTH
527 Pass a long as parameter, which is set to a bitmask, to tell libcurl what
528 authentication method(s) you want it to use. The available bits are listed
529 below. If more than one bit is set, libcurl will first query the site to see
530 what authentication methods it supports and then pick the best one you allow
531 it to use. For some methods, this will induce an extra network round-trip. Set
532 the actual name and password with the \fICURLOPT_USERPWD\fP option. (Added in
533 7.10.6)
535 .IP CURLAUTH_BASIC
536 HTTP Basic authentication. This is the default choice, and the only method
537 that is in wide-spread use and supported virtually everywhere. This is sending
538 the user name and password over the network in plain text, easily captured by
539 others.
540 .IP CURLAUTH_DIGEST
541 HTTP Digest authentication.  Digest authentication is defined in RFC2617 and
542 is a more secure way to do authentication over public networks than the
543 regular old-fashioned Basic method.
544 .IP CURLAUTH_GSSNEGOTIATE
545 HTTP GSS-Negotiate authentication. The GSS-Negotiate (also known as plain
546 \&"Negotiate") method was designed by Microsoft and is used in their web
547 applications. It is primarily meant as a support for Kerberos5 authentication
548 but may be also used along with another authentication methods. For more
549 information see IETF draft draft-brezak-spnego-http-04.txt.
551 You need to build libcurl with a suitable GSS-API library for this to work.
552 .IP CURLAUTH_NTLM
553 HTTP NTLM authentication. A proprietary protocol invented and used by
554 Microsoft. It uses a challenge-response and hash concept similar to Digest, to
555 prevent the password from being eavesdropped.
557 You need to build libcurl with OpenSSL support for this option to work, or
558 build libcurl on Windows.
559 .IP CURLAUTH_ANY
560 This is a convenience macro that sets all bits and thus makes libcurl pick any
561 it finds suitable. libcurl will automatically select the one it finds most
562 secure.
563 .IP CURLAUTH_ANYSAFE
564 This is a convenience macro that sets all bits except Basic and thus makes
565 libcurl pick any it finds suitable. libcurl will automatically select the one it
566 finds most secure.
568 .IP CURLOPT_PROXYAUTH
569 Pass a long as parameter, which is set to a bitmask, to tell libcurl what
570 authentication method(s) you want it to use for your proxy authentication.  If
571 more than one bit is set, libcurl will first query the site to see what
572 authentication methods it supports and then pick the best one you allow it to
573 use. For some methods, this will induce an extra network round-trip. Set the
574 actual name and password with the \fICURLOPT_PROXYUSERPWD\fP option. The
575 bitmask can be constructed by or'ing together the bits listed above for the
576 \fICURLOPT_HTTPAUTH\fP option. As of this writing, only Basic, Digest and NTLM
577 work. (Added in 7.10.7)
578 .SH HTTP OPTIONS
579 .IP CURLOPT_AUTOREFERER
580 Pass a non-zero parameter to enable this. When enabled, libcurl will
581 automatically set the Referer: field in requests where it follows a Location:
582 redirect.
583 .IP CURLOPT_ENCODING
584 Sets the contents of the Accept-Encoding: header sent in an HTTP
585 request, and enables decoding of a response when a Content-Encoding:
586 header is received.  Three encodings are supported: \fIidentity\fP,
587 which does nothing, \fIdeflate\fP which requests the server to
588 compress its response using the zlib algorithm, and \fIgzip\fP which
589 requests the gzip algorithm.  If a zero-length string is set, then an
590 Accept-Encoding: header containing all supported encodings is sent.
592 This is a request, not an order; the server may or may not do it.  This
593 option must be set (to any non-NULL value) or else any unsolicited
594 encoding done by the server is ignored. See the special file
595 lib/README.encoding for details.
596 .IP CURLOPT_FOLLOWLOCATION
597 A non-zero parameter tells the library to follow any Location: header that the
598 server sends as part of an HTTP header.
600 This means that the library will re-send the same request on the new location
601 and follow new Location: headers all the way until no more such headers are
602 returned. \fICURLOPT_MAXREDIRS\fP can be used to limit the number of redirects
603 libcurl will follow.
604 .IP CURLOPT_UNRESTRICTED_AUTH
605 A non-zero parameter tells the library it can continue to send authentication
606 (user+password) when following locations, even when hostname changed. This
607 option is meaningful only when setting \fICURLOPT_FOLLOWLOCATION\fP.
608 .IP CURLOPT_MAXREDIRS
609 Pass a long. The set number will be the redirection limit. If that many
610 redirections have been followed, the next redirect will cause an error
611 (\fICURLE_TOO_MANY_REDIRECTS\fP). This option only makes sense if the
612 \fICURLOPT_FOLLOWLOCATION\fP is used at the same time. Added in 7.15.1:
613 Setting the limit to 0 will make libcurl refuse any redirect. Set it to -1 for
614 an infinite number of redirects (which is the default)
615 .IP CURLOPT_PUT
616 A non-zero parameter tells the library to use HTTP PUT to transfer data. The
617 data should be set with \fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE\fP.
619 This option is deprecated and starting with version 7.12.1 you should instead
620 use \fICURLOPT_UPLOAD\fP.
621 .IP CURLOPT_POST
622 A non-zero parameter tells the library to do a regular HTTP post. This will
623 also make the library use the a "Content-Type:
624 application/x-www-form-urlencoded" header. (This is by far the most commonly
625 used POST method).
627 Use the \fICURLOPT_POSTFIELDS\fP option to specify what data to post and
628 \fICURLOPT_POSTFIELDSIZE\fP to set the data size.
630 Optionally, you can provide data to POST using the \fICURLOPT_READFUNCTION\fP
631 and \fICURLOPT_READDATA\fP options but then you must make sure to not set
632 \fICURLOPT_POSTFIELDS\fP to anything but NULL. When providing data with a
633 callback, you must transmit it using chunked transfer-encoding or you must set
634 the size of the data with the \fICURLOPT_POSTFIELDSIZE\fP option.
636 You can override the default POST Content-Type: header by setting your own
637 with \fICURLOPT_HTTPHEADER\fP.
639 Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
640 You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
642 If you use POST to a HTTP 1.1 server, you can send data without knowing the
643 size before starting the POST if you use chunked encoding. You enable this by
644 adding a header like "Transfer-Encoding: chunked" with
645 \fICURLOPT_HTTPHEADER\fP. With HTTP 1.0 or without chunked transfer, you must
646 specify the size in the request.
648 When setting \fICURLOPT_POST\fP to a non-zero value, it will automatically set
649 \fICURLOPT_NOBODY\fP to 0 (since 7.14.1).
651 If you issue a POST request and then want to make a HEAD or GET using the same
652 re-used handle, you must explicitly set the new request type using
653 \fICURLOPT_NOBODY\fP or \fICURLOPT_HTTPGET\fP or similar.
654 .IP CURLOPT_POSTFIELDS
655 Pass a char * as parameter, which should be the full data to post in an HTTP
656 POST operation. You must make sure that the data is formatted the way you want
657 the server to receive it. libcurl will not convert or encode it for you. Most
658 web servers will assume this data to be url-encoded. Take note.
660 This POST is a normal application/x-www-form-urlencoded kind (and libcurl will
661 set that Content-Type by default when this option is used), which is the most
662 commonly used one by HTML forms. See also the \fICURLOPT_POST\fP. Using
663 \fICURLOPT_POSTFIELDS\fP implies \fICURLOPT_POST\fP.
665 Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
666 You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
668 To make multipart/formdata posts (aka rfc1867-posts), check out the
669 \fICURLOPT_HTTPPOST\fP option.
670 .IP CURLOPT_POSTFIELDSIZE
671 If you want to post data to the server without letting libcurl do a strlen()
672 to measure the data size, this option must be used. When this option is used
673 you can post fully binary data, which otherwise is likely to fail. If this
674 size is set to -1, the library will use strlen() to get the size.
675 .IP CURLOPT_POSTFIELDSIZE_LARGE
676 Pass a curl_off_t as parameter. Use this to set the size of the
677 \fICURLOPT_POSTFIELDS\fP data to prevent libcurl from doing strlen() on the
678 data to figure out the size. This is the large file version of the
679 \fICURLOPT_POSTFIELDSIZE\fP option. (Added in 7.11.1)
680 .IP CURLOPT_HTTPPOST
681 Tells libcurl you want a multipart/formdata HTTP POST to be made and you
682 instruct what data to pass on to the server.  Pass a pointer to a linked list
683 of curl_httppost structs as parameter. . The easiest way to create such a
684 list, is to use \fIcurl_formadd(3)\fP as documented. The data in this list
685 must remain intact until you close this curl handle again with
686 \fIcurl_easy_cleanup(3)\fP.
688 Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
689 You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
691 When setting \fICURLOPT_HTTPPOST\fP, it will automatically set
692 \fICURLOPT_NOBODY\fP to 0 (since 7.14.1).
693 .IP CURLOPT_REFERER
694 Pass a pointer to a zero terminated string as parameter. It will be used to
695 set the Referer: header in the http request sent to the remote server. This
696 can be used to fool servers or scripts. You can also set any custom header
697 with \fICURLOPT_HTTPHEADER\fP.
698 .IP CURLOPT_USERAGENT
699 Pass a pointer to a zero terminated string as parameter. It will be used to
700 set the User-Agent: header in the http request sent to the remote server. This
701 can be used to fool servers or scripts. You can also set any custom header
702 with \fICURLOPT_HTTPHEADER\fP.
703 .IP CURLOPT_HTTPHEADER
704 Pass a pointer to a linked list of HTTP headers to pass to the server in your
705 HTTP request. The linked list should be a fully valid list of \fBstruct
706 curl_slist\fP structs properly filled in. Use \fIcurl_slist_append(3)\fP to
707 create the list and \fIcurl_slist_free_all(3)\fP to clean up an entire
708 list. If you add a header that is otherwise generated and used by libcurl
709 internally, your added one will be used instead. If you add a header with no
710 contents as in 'Accept:' (no data on the right side of the colon), the
711 internally used header will get disabled. Thus, using this option you can add
712 new headers, replace internal headers and remove internal headers. To add a
713 header with no contents, make the contents be two quotes: \&"". The headers
714 included in the linked list must not be CRLF-terminated, because curl adds
715 CRLF after each header item. Failure to comply with this will result in
716 strange bugs because the server will most likely ignore part of the headers
717 you specified.
719 The first line in a request (containing the method, usually a GET or POST) is
720 not a header and cannot be replaced using this option. Only the lines
721 following the request-line are headers. Adding this method line in this list
722 of headers will only cause your request to send an invalid header.
724 Pass a NULL to this to reset back to no custom headers.
726 The most commonly replaced headers have "shortcuts" in the options
727 \fICURLOPT_COOKIE\fP, \fICURLOPT_USERAGENT\fP and \fICURLOPT_REFERER\fP.
728 .IP CURLOPT_HTTP200ALIASES
729 Pass a pointer to a linked list of aliases to be treated as valid HTTP 200
730 responses.  Some servers respond with a custom header response line.  For
731 example, IceCast servers respond with "ICY 200 OK".  By including this string
732 in your list of aliases, the response will be treated as a valid HTTP header
733 line such as "HTTP/1.0 200 OK". (Added in 7.10.3)
735 The linked list should be a fully valid list of struct curl_slist structs, and
736 be properly filled in.  Use \fIcurl_slist_append(3)\fP to create the list and
737 \fIcurl_slist_free_all(3)\fP to clean up an entire list.
739 The alias itself is not parsed for any version strings. Before libcurl 7.16.3,
740 Libcurl used the value set by option \fICURLOPT_HTTP_VERSION\fP, but starting
741 with 7.16.3 the protocol is assumed to match HTTP 1.0 when an alias matched.
742 .IP CURLOPT_COOKIE
743 Pass a pointer to a zero terminated string as parameter. It will be used to
744 set a cookie in the http request. The format of the string should be
745 NAME=CONTENTS, where NAME is the cookie name and CONTENTS is what the cookie
746 should contain.
748 If you need to set multiple cookies, you need to set them all using a single
749 option and thus you need to concatenate them all in one single string. Set
750 multiple cookies in one string like this: "name1=content1; name2=content2;"
751 etc.
753 Using this option multiple times will only make the latest string override the
754 previously ones.
755 .IP CURLOPT_COOKIEFILE
756 Pass a pointer to a zero terminated string as parameter. It should contain the
757 name of your file holding cookie data to read. The cookie data may be in
758 Netscape / Mozilla cookie data format or just regular HTTP-style headers
759 dumped to a file.
761 Given an empty or non-existing file or by passing the empty string (""), this
762 option will enable cookies for this curl handle, making it understand and
763 parse received cookies and then use matching cookies in future request.
765 If you use this option multiple times, you just add more files to read.
766 Subsequent files will add more cookies.
767 .IP CURLOPT_COOKIEJAR
768 Pass a file name as char *, zero terminated. This will make libcurl write all
769 internally known cookies to the specified file when \fIcurl_easy_cleanup(3)\fP
770 is called. If no cookies are known, no file will be created. Specify "-" to
771 instead have the cookies written to stdout. Using this option also enables
772 cookies for this session, so if you for example follow a location it will make
773 matching cookies get sent accordingly.
775 If the cookie jar file can't be created or written to (when the
776 \fIcurl_easy_cleanup(3)\fP is called), libcurl will not and cannot report an
777 error for this. Using \fICURLOPT_VERBOSE\fP or \fICURLOPT_DEBUGFUNCTION\fP
778 will get a warning to display, but that is the only visible feedback you get
779 about this possibly lethal situation.
780 .IP CURLOPT_COOKIESESSION
781 Pass a long set to non-zero to mark this as a new cookie "session". It will
782 force libcurl to ignore all cookies it is about to load that are "session
783 cookies" from the previous session. By default, libcurl always stores and
784 loads all cookies, independent if they are session cookies are not. Session
785 cookies are cookies without expiry date and they are meant to be alive and
786 existing for this "session" only.
787 .IP CURLOPT_COOKIELIST
788 Pass a char * to a cookie string. Cookie can be either in Netscape / Mozilla
789 format or just regular HTTP-style header (Set-Cookie: ...) format. If cURL
790 cookie engine was not enabled it will enable its cookie engine.  Passing a
791 magic string \&"ALL" will erase all cookies known by cURL. (Added in 7.14.1)
792 Passing the special string \&"SESS" will only erase all session cookies known
793 by cURL. (Added in 7.15.4)
794 .IP CURLOPT_HTTPGET
795 Pass a long. If the long is non-zero, this forces the HTTP request to get back
796 to GET. usable if a POST, HEAD, PUT or a custom request have been used
797 previously using the same curl handle.
799 When setting \fICURLOPT_HTTPGET\fP to a non-zero value, it will automatically
800 set \fICURLOPT_NOBODY\fP to 0 (since 7.14.1).
801 .IP CURLOPT_HTTP_VERSION
802 Pass a long, set to one of the values described below. They force libcurl to
803 use the specific HTTP versions. This is not sensible to do unless you have a
804 good reason.
806 .IP CURL_HTTP_VERSION_NONE
807 We don't care about what version the library uses. libcurl will use whatever
808 it thinks fit.
809 .IP CURL_HTTP_VERSION_1_0
810 Enforce HTTP 1.0 requests.
811 .IP CURL_HTTP_VERSION_1_1
812 Enforce HTTP 1.1 requests.
814 .IP CURLOPT_IGNORE_CONTENT_LENGTH
815 Ignore the Content-Length header. This is useful for Apache 1.x (and similar
816 servers) which will report incorrect content length for files over 2
817 gigabytes. If this option is used, curl will not be able to accurately report
818 progress, and will simply stop the download when the server ends the
819 connection. (added in 7.14.1)
820 .IP CURLOPT_HTTP_CONTENT_DECODING
821 Pass a long to tell libcurl how to act on content decoding. If set to zero,
822 content decoding will be disabled. If set to 1 it is enabled. Note however
823 that libcurl has no default content decoding but requires you to use
824 \fICURLOPT_ENCODING\fP for that. (added in 7.16.2)
825 .IP CURLOPT_HTTP_TRANSFER_DECODING
826 Pass a long to tell libcurl how to act on transfer decoding. If set to zero,
827 transfer decoding will be disabled, if set to 1 it is enabled
828 (default). libcurl does chunked transfer decoding by default unless this
829 option is set to zero. (added in 7.16.2)
830 .SH FTP OPTIONS
831 .IP CURLOPT_FTPPORT
832 Pass a pointer to a zero terminated string as parameter. It will be used to
833 get the IP address to use for the ftp PORT instruction. The PORT instruction
834 tells the remote server to connect to our specified IP address. The string may
835 be a plain IP address, a host name, an network interface name (under Unix) or
836 just a '-' letter to let the library use your systems default IP
837 address. Default FTP operations are passive, and thus won't use PORT.
839 You disable PORT again and go back to using the passive version by setting
840 this option to NULL.
841 .IP CURLOPT_QUOTE
842 Pass a pointer to a linked list of FTP or SFTP commands to pass to
843 the server prior to your ftp request. This will be done before any
844 other commands are issued (even before the CWD command for FTP). The
845 linked list should be a fully valid list of 'struct curl_slist' structs
846 properly filled in with text strings. Use \fIcurl_slist_append(3)\fP
847 to append strings (commands) to the list, and clear the entire list
848 afterwards with \fIcurl_slist_free_all(3)\fP. Disable this operation
849 again by setting a NULL to this option.
850 .IP CURLOPT_POSTQUOTE
851 Pass a pointer to a linked list of FTP or SFTP commands to pass to the
852 server after your ftp transfer request. The linked list should be a
853 fully valid list of struct curl_slist structs properly filled in as
854 described for \fICURLOPT_QUOTE\fP. Disable this operation again by
855 setting a NULL to this option.
856 .IP CURLOPT_PREQUOTE
857 Pass a pointer to a linked list of FTP commands to pass to the server after
858 the transfer type is set. The linked list should be a fully valid list of
859 struct curl_slist structs properly filled in as described for
860 \fICURLOPT_QUOTE\fP. Disable this operation again by setting a NULL to this
861 option. Before version 7.15.6, if you also set \fICURLOPT_NOBODY\fP non-zero,
862 this option didn't work.
863 .IP CURLOPT_FTPLISTONLY
864 A non-zero parameter tells the library to just list the names of an ftp
865 directory, instead of doing a full directory listing that would include file
866 sizes, dates etc.
868 This causes an FTP NLST command to be sent.  Beware that some FTP servers list
869 only files in their response to NLST; they might not include subdirectories
870 and symbolic links.
871 .IP CURLOPT_FTPAPPEND
872 A non-zero parameter tells the library to append to the remote file instead of
873 overwrite it. This is only useful when uploading to an ftp site.
874 .IP CURLOPT_FTP_USE_EPRT
875 Pass a long. If the value is non-zero, it tells curl to use the EPRT (and
876 LPRT) command when doing active FTP downloads (which is enabled by
877 \fICURLOPT_FTPPORT\fP). Using EPRT means that it will first attempt to use
878 EPRT and then LPRT before using PORT, but if you pass FALSE (zero) to this
879 option, it will not try using EPRT or LPRT, only plain PORT. (Added in 7.10.5)
881 If the server is an IPv6 host, this option will have no effect as of 7.12.3.
882 .IP CURLOPT_FTP_USE_EPSV
883 Pass a long. If the value is non-zero, it tells curl to use the EPSV command
884 when doing passive FTP downloads (which it always does by default). Using EPSV
885 means that it will first attempt to use EPSV before using PASV, but if you
886 pass FALSE (zero) to this option, it will not try using EPSV, only plain PASV.
888 If the server is an IPv6 host, this option will have no effect as of 7.12.3.
889 .IP CURLOPT_FTP_CREATE_MISSING_DIRS
890 Pass a long. If the value is non-zero, curl will attempt to create any remote
891 directory that it fails to CWD into. CWD is the command that changes working
892 directory. (Added in 7.10.7)
894 This setting also applies to SFTP-connections. curl will attempt to create
895 the remote directory if it can't obtain a handle to the target-location. The
896 creation will fail if a file of the same name as the directory to create
897 already exists or lack of permissions prevents creation. (Added in 7.16.3)
898 .IP CURLOPT_FTP_RESPONSE_TIMEOUT
899 Pass a long.  Causes curl to set a timeout period (in seconds) on the amount
900 of time that the server is allowed to take in order to generate a response
901 message for a command before the session is considered hung.  While curl is
902 waiting for a response, this value overrides \fICURLOPT_TIMEOUT\fP. It is
903 recommended that if used in conjunction with \fICURLOPT_TIMEOUT\fP, you set
904 \fICURLOPT_FTP_RESPONSE_TIMEOUT\fP to a value smaller than
905 \fICURLOPT_TIMEOUT\fP.  (Added in 7.10.8)
906 .IP CURLOPT_FTP_ALTERNATIVE_TO_USER
907 Pass a char * as parameter, pointing to a string which will be used to
908 authenticate if the usual FTP "USER user" and "PASS password" negotiation
909 fails. This is currently only known to be required when connecting to
910 Tumbleweed's Secure Transport FTPS server using client certificates for
911 authentication. (Added in 7.15.5)
912 .IP CURLOPT_FTP_SKIP_PASV_IP
913 Pass a long. If set to a non-zero value, it instructs libcurl to not use the
914 IP address the server suggests in its 227-response to libcurl's PASV command
915 when libcurl connects the data connection. Instead libcurl will re-use the
916 same IP address it already uses for the control connection. But it will use
917 the port number from the 227-response. (Added in 7.14.2)
919 This option has no effect if PORT, EPRT or EPSV is used instead of PASV.
920 .IP CURLOPT_FTP_SSL
921 Pass a long using one of the values from below, to make libcurl use your
922 desired level of SSL for the ftp transfer. (Added in 7.11.0)
924 .IP CURLFTPSSL_NONE
925 Don't attempt to use SSL.
926 .IP CURLFTPSSL_TRY
927 Try using SSL, proceed as normal otherwise.
928 .IP CURLFTPSSL_CONTROL
929 Require SSL for the control connection or fail with \fICURLE_FTP_SSL_FAILED\fP.
930 .IP CURLFTPSSL_ALL
931 Require SSL for all communication or fail with \fICURLE_FTP_SSL_FAILED\fP.
933 .IP CURLOPT_FTPSSLAUTH
934 Pass a long using one of the values from below, to alter how libcurl issues
935 \&"AUTH TLS" or "AUTH SSL" when FTP over SSL is activated (see
936 \fICURLOPT_FTP_SSL\fP). (Added in 7.12.2)
938 .IP CURLFTPAUTH_DEFAULT
939 Allow libcurl to decide
940 .IP CURLFTPAUTH_SSL
941 Try "AUTH SSL" first, and only if that fails try "AUTH TLS"
942 .IP CURLFTPAUTH_TLS
943 Try "AUTH TLS" first, and only if that fails try "AUTH SSL"
945 .IP CURLOPT_FTP_SSL_CCC
946 If enabled, this option makes libcurl use CCC (Clear Command Channel). It
947 shuts down the SSL/TLS layer after authenticating. The rest of the
948 control channel communication will be unencrypted. This allows NAT routers
949 to follow the FTP transaction. Pass a long using one of the values below.
950 (Added in 7.16.1)
952 .IP CURLFTPSSL_CCC_NONE
953 Don't attempt to use CCC.
954 .IP CURLFTPSSL_CCC_PASSIVE
955 Do not initiate the shutdown, but wait for the server to do it. Do not send
956 a reply.
957 .IP CURLFTPSSL_CCC_ACTIVE
958 Initiate the shutdown and wait for a reply.
960 .IP CURLOPT_FTP_ACCOUNT
961 Pass a pointer to a zero-terminated string (or NULL to disable). When an FTP
962 server asks for "account data" after user name and password has been provided,
963 this data is sent off using the ACCT command. (Added in 7.13.0)
964 .IP CURLOPT_FTP_FILEMETHOD
965 Pass a long that should have one of the following values. This option controls
966 what method libcurl should use to reach a file on a FTP(S) server. The
967 argument should be one of the following alternatives:
969 .IP CURLFTPMETHOD_MULTICWD
970 libcurl does a single CWD operation for each path part in the given URL. For
971 deep hierarchies this means very many commands. This is how RFC1738 says it
972 should be done. This is the default but the slowest behavior.
973 .IP CURLFTPMETHOD_NOCWD
974 libcurl does no CWD at all. libcurl will do SIZE, RETR, STOR etc and give a
975 full path to the server for all these commands. This is the fastest behavior.
976 .IP CURLFTPMETHOD_SINGLECWD
977 libcurl does one CWD with the full target directory and then operates on the
978 file \&"normally" (like in the multicwd case). This is somewhat more standards
979 compliant than 'nocwd' but without the full penalty of 'multicwd'.
981 .SH PROTOCOL OPTIONS
982 .IP CURLOPT_TRANSFERTEXT
983 A non-zero parameter tells the library to use ASCII mode for ftp transfers,
984 instead of the default binary transfer. For win32 systems it does not set the
985 stdout to binary mode. This option can be usable when transferring text data
986 between systems with different views on certain characters, such as newlines
987 or similar.
989 libcurl does not do a complete ASCII conversion when doing ASCII transfers
990 over FTP. This is a known limitation/flaw that nobody has rectified. libcurl
991 simply sets the mode to ascii and performs a standard transfer.
992 .IP CURLOPT_CRLF
993 Convert Unix newlines to CRLF newlines on transfers.
994 .IP CURLOPT_RANGE
995 Pass a char * as parameter, which should contain the specified range you
996 want. It should be in the format "X-Y", where X or Y may be left out. HTTP
997 transfers also support several intervals, separated with commas as in
998 \fI"X-Y,N-M"\fP. Using this kind of multiple intervals will cause the HTTP
999 server to send the response document in pieces (using standard MIME separation
1000 techniques). Pass a NULL to this option to disable the use of ranges.
1001 .IP CURLOPT_RESUME_FROM
1002 Pass a long as parameter. It contains the offset in number of bytes that you
1003 want the transfer to start from. Set this option to 0 to make the transfer
1004 start from the beginning (effectively disabling resume). For FTP, set this
1005 option to -1 to make the transfer start from the end of the target file
1006 (useful to continue an interrupted upload).
1007 .IP CURLOPT_RESUME_FROM_LARGE
1008 Pass a curl_off_t as parameter. It contains the offset in number of bytes that
1009 you want the transfer to start from. (Added in 7.11.0)
1010 .IP CURLOPT_CUSTOMREQUEST
1011 Pass a pointer to a zero terminated string as parameter. It will be user
1012 instead of GET or HEAD when doing an HTTP request, or instead of LIST or NLST
1013 when doing an ftp directory listing. This is useful for doing DELETE or other
1014 more or less obscure HTTP requests. Don't do this at will, make sure your
1015 server supports the command first.
1017 Restore to the internal default by setting this to NULL.
1019 Many people have wrongly used this option to replace the entire request with
1020 their own, including multiple headers and POST contents. While that might work
1021 in many cases, it will cause libcurl to send invalid requests and it could
1022 possibly confuse the remote server badly. Use \fICURLOPT_POST\fP and
1023 \fICURLOPT_POSTFIELDS\fP to set POST data. Use \fICURLOPT_HTTPHEADER\fP to
1024 replace or extend the set of headers sent by libcurl. Use
1025 \fICURLOPT_HTTP_VERSION\fP to change HTTP version.
1026 .IP CURLOPT_FILETIME
1027 Pass a long. If it is a non-zero value, libcurl will attempt to get the
1028 modification date of the remote document in this operation. This requires that
1029 the remote server sends the time or replies to a time querying command. The
1030 \fIcurl_easy_getinfo(3)\fP function with the \fICURLINFO_FILETIME\fP argument
1031 can be used after a transfer to extract the received time (if any).
1032 .IP CURLOPT_NOBODY
1033 A non-zero parameter tells the library to not include the body-part in the
1034 output. This is only relevant for protocols that have separate header and body
1035 parts. On HTTP(S) servers, this will make libcurl do a HEAD request.
1037 To change request to GET, you should use \fICURLOPT_HTTPGET\fP. Change request
1038 to POST with \fICURLOPT_POST\fP etc.
1039 .IP CURLOPT_INFILESIZE
1040 When uploading a file to a remote site, this option should be used to tell
1041 libcurl what the expected size of the infile is. This value should be passed
1042 as a long. See also \fICURLOPT_INFILESIZE_LARGE\fP.
1044 For uploading using SCP, this option or \fICURLOPT_INFILESIZE_LARGE\fP is
1045 mandatory.
1047 Note that this option does not limit how much data libcurl will actually send,
1048 as that is controlled entirely by what the read callback returns.
1049 .IP CURLOPT_INFILESIZE_LARGE
1050 When uploading a file to a remote site, this option should be used to tell
1051 libcurl what the expected size of the infile is.  This value should be passed
1052 as a curl_off_t. (Added in 7.11.0)
1054 For uploading using SCP, this option or \fICURLOPT_INFILESIZE\fP is mandatory.
1056 Note that this option does not limit how much data libcurl will actually send,
1057 as that is controlled entirely by what the read callback returns.
1058 .IP CURLOPT_UPLOAD
1059 A non-zero parameter tells the library to prepare for an upload. The
1060 \fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE\fP or
1061 \fICURLOPT_INFILESIZE_LARGE\fP options are also interesting for uploads. If
1062 the protocol is HTTP, uploading means using the PUT request unless you tell
1063 libcurl otherwise.
1065 Using PUT with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
1066 You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
1068 If you use PUT to a HTTP 1.1 server, you can upload data without knowing the
1069 size before starting the transfer if you use chunked encoding. You enable this
1070 by adding a header like "Transfer-Encoding: chunked" with
1071 \fICURLOPT_HTTPHEADER\fP. With HTTP 1.0 or without chunked transfer, you must
1072 specify the size.
1073 .IP CURLOPT_MAXFILESIZE
1074 Pass a long as parameter. This allows you to specify the maximum size (in
1075 bytes) of a file to download. If the file requested is larger than this value,
1076 the transfer will not start and CURLE_FILESIZE_EXCEEDED will be returned.
1078 The file size is not always known prior to download, and for such files this
1079 option has no effect even if the file transfer ends up being larger than this
1080 given limit. This concerns both FTP and HTTP transfers.
1081 .IP CURLOPT_MAXFILESIZE_LARGE
1082 Pass a curl_off_t as parameter. This allows you to specify the maximum size
1083 (in bytes) of a file to download. If the file requested is larger than this
1084 value, the transfer will not start and \fICURLE_FILESIZE_EXCEEDED\fP will be
1085 returned. (Added in 7.11.0)
1087 The file size is not always known prior to download, and for such files this
1088 option has no effect even if the file transfer ends up being larger than this
1089 given limit. This concerns both FTP and HTTP transfers.
1090 .IP CURLOPT_TIMECONDITION
1091 Pass a long as parameter. This defines how the \fICURLOPT_TIMEVALUE\fP time
1092 value is treated. You can set this parameter to \fICURL_TIMECOND_IFMODSINCE\fP
1093 or \fICURL_TIMECOND_IFUNMODSINCE\fP. This feature applies to HTTP and FTP.
1095 The last modification time of a file is not always known and in such instances
1096 this feature will have no effect even if the given time condition would have
1097 not been met.
1098 .IP CURLOPT_TIMEVALUE
1099 Pass a long as parameter. This should be the time in seconds since 1 jan 1970,
1100 and the time will be used in a condition as specified with
1101 \fICURLOPT_TIMECONDITION\fP.
1102 .SH CONNECTION OPTIONS
1103 .IP CURLOPT_TIMEOUT
1104 Pass a long as parameter containing the maximum time in seconds that you allow
1105 the libcurl transfer operation to take. Normally, name lookups can take a
1106 considerable time and limiting operations to less than a few minutes risk
1107 aborting perfectly normal operations. This option will cause curl to use the
1108 SIGALRM to enable time-outing system calls.
1110 In unix-like systems, this might cause signals to be used unless
1111 \fICURLOPT_NOSIGNAL\fP is set.
1112 .IP CURLOPT_TIMEOUT_MS
1113 Like \fICURLOPT_TIMEOUT\fP but takes number of milliseconds instead. If
1114 libcurl is built to use the standard system name resolver, that part will
1115 still use full-second resolution for timeouts. (Added in 7.16.2)
1116 .IP CURLOPT_LOW_SPEED_LIMIT
1117 Pass a long as parameter. It contains the transfer speed in bytes per second
1118 that the transfer should be below during \fICURLOPT_LOW_SPEED_TIME\fP seconds
1119 for the library to consider it too slow and abort.
1120 .IP CURLOPT_LOW_SPEED_TIME
1121 Pass a long as parameter. It contains the time in seconds that the transfer
1122 should be below the \fICURLOPT_LOW_SPEED_LIMIT\fP for the library to consider
1123 it too slow and abort.
1124 .IP CURLOPT_MAX_SEND_SPEED_LARGE
1125 Pass a curl_off_t as parameter.  If an upload exceeds this speed on cumulative
1126 average during the transfer, the transfer will pause to keep the average rate
1127 less than or equal to the parameter value.  Defaults to unlimited
1128 speed. (Added in 7.15.5)
1129 .IP CURLOPT_MAX_RECV_SPEED_LARGE
1130 Pass a curl_off_t as parameter.  If a download exceeds this speed on
1131 cumulative average during the transfer, the transfer will pause to keep the
1132 average rate less than or equal to the parameter value. Defaults to unlimited
1133 speed. (Added in 7.15.5)
1134 .IP CURLOPT_MAXCONNECTS
1135 Pass a long. The set number will be the persistent connection cache size. The
1136 set amount will be the maximum amount of simultaneously open connections that
1137 libcurl may cache in this easy handle. Default is 5, and there isn't much
1138 point in changing this value unless you are perfectly aware of how this work
1139 and changes libcurl's behaviour. This concerns connection using any of the
1140 protocols that support persistent connections.
1142 When reaching the maximum limit, curl closes the oldest one in the cache to
1143 prevent the number of open connections to increase.
1145 If you already have performed transfers with this curl handle, setting a
1146 smaller MAXCONNECTS than before may cause open connections to get closed
1147 unnecessarily.
1149 Note that if you add this easy handle to a multi handle, this setting is not
1150 being acknowledged, but you must instead use \fIcurl_multi_setopt(3)\fP and
1151 the \fICURLMOPT_MAXCONNECTS\fP option.
1152 .IP CURLOPT_CLOSEPOLICY
1153 (Obsolete) This option does nothing.
1154 .IP CURLOPT_FRESH_CONNECT
1155 Pass a long. Set to non-zero to make the next transfer use a new (fresh)
1156 connection by force. If the connection cache is full before this connection,
1157 one of the existing connections will be closed as according to the selected or
1158 default policy. This option should be used with caution and only if you
1159 understand what it does. Set this to 0 to have libcurl attempt re-using an
1160 existing connection (default behavior).
1161 .IP CURLOPT_FORBID_REUSE
1162 Pass a long. Set to non-zero to make the next transfer explicitly close the
1163 connection when done. Normally, libcurl keep all connections alive when done
1164 with one transfer in case there comes a succeeding one that can re-use them.
1165 This option should be used with caution and only if you understand what it
1166 does. Set to 0 to have libcurl keep the connection open for possibly later
1167 re-use (default behavior).
1168 .IP CURLOPT_CONNECTTIMEOUT
1169 Pass a long. It should contain the maximum time in seconds that you allow the
1170 connection to the server to take.  This only limits the connection phase, once
1171 it has connected, this option is of no more use. Set to zero to disable
1172 connection timeout (it will then only timeout on the system's internal
1173 timeouts). See also the \fICURLOPT_TIMEOUT\fP option.
1175 In unix-like systems, this might cause signals to be used unless
1176 \fICURLOPT_NOSIGNAL\fP is set.
1177 .IP CURLOPT_CONNECTTIMEOUT_MS
1178 Like \fICURLOPT_CONNECTTIMEOUT\fP but takes number of milliseconds instead. If
1179 libcurl is built to use the standard system name resolver, that part will
1180 still use full-second resolution for timeouts. (Added in 7.16.2)
1181 .IP CURLOPT_IPRESOLVE
1182 Allows an application to select what kind of IP addresses to use when
1183 resolving host names. This is only interesting when using host names that
1184 resolve addresses using more than one version of IP. The allowed values are:
1186 .IP CURL_IPRESOLVE_WHATEVER
1187 Default, resolves addresses to all IP versions that your system allows.
1188 .IP CURL_IPRESOLVE_V4
1189 Resolve to ipv4 addresses.
1190 .IP CURL_IPRESOLVE_V6
1191 Resolve to ipv6 addresses.
1193 .IP CURLOPT_CONNECT_ONLY
1194 Pass a long. A non-zero parameter tells the library to perform any required
1195 proxy authentication and connection setup, but no data transfer.
1197 This option is useful with the \fICURLINFO_LASTSOCKET\fP option to
1198 \fIcurl_easy_getinfo(3)\fP. The library can set up the connection and then the
1199 application can obtain the most recently used socket for special data
1200 transfers. (Added in 7.15.2)
1201 .SH SSL and SECURITY OPTIONS
1202 .IP CURLOPT_SSLCERT
1203 Pass a pointer to a zero terminated string as parameter. The string should be
1204 the file name of your certificate. The default format is "PEM" and can be
1205 changed with \fICURLOPT_SSLCERTTYPE\fP.
1207 With NSS this is the nickname of the certificate you wish to authenticate
1208 with.
1209 .IP CURLOPT_SSLCERTTYPE
1210 Pass a pointer to a zero terminated string as parameter. The string should be
1211 the format of your certificate. Supported formats are "PEM" and "DER".  (Added
1212 in 7.9.3)
1213 .IP CURLOPT_SSLCERTPASSWD
1214 Pass a pointer to a zero terminated string as parameter. It will be used as
1215 the password required to use the \fICURLOPT_SSLCERT\fP certificate.
1217 This option is replaced by \fICURLOPT_SSLKEYPASSWD\fP and should only be used
1218 for backward compatibility. You never needed a pass phrase to load a
1219 certificate but you need one to load your private key.
1220 .IP CURLOPT_SSLKEY
1221 Pass a pointer to a zero terminated string as parameter. The string should be
1222 the file name of your private key. The default format is "PEM" and can be
1223 changed with \fICURLOPT_SSLKEYTYPE\fP.
1224 .IP CURLOPT_SSLKEYTYPE
1225 Pass a pointer to a zero terminated string as parameter. The string should be
1226 the format of your private key. Supported formats are "PEM", "DER" and "ENG".
1228 The format "ENG" enables you to load the private key from a crypto engine. In
1229 this case \fICURLOPT_SSLKEY\fP is used as an identifier passed to the
1230 engine. You have to set the crypto engine with \fICURLOPT_SSLENGINE\fP.
1231 \&"DER" format key file currently does not work because of a bug in OpenSSL.
1232 .IP CURLOPT_SSLKEYPASSWD
1233 Pass a pointer to a zero terminated string as parameter. It will be used as
1234 the password required to use the \fICURLOPT_SSLKEY\fP or
1235 \fICURLOPT_SSH_PRIVATE_KEYFILE\fP private key.
1236 .IP CURLOPT_SSLENGINE
1237 Pass a pointer to a zero terminated string as parameter. It will be used as
1238 the identifier for the crypto engine you want to use for your private
1239 key.
1241 If the crypto device cannot be loaded, \fICURLE_SSL_ENGINE_NOTFOUND\fP is
1242 returned.
1243 .IP CURLOPT_SSLENGINE_DEFAULT
1244 Sets the actual crypto engine as the default for (asymmetric) crypto
1245 operations.
1247 If the crypto device cannot be set, \fICURLE_SSL_ENGINE_SETFAILED\fP is
1248 returned.
1249 .IP CURLOPT_SSLVERSION
1250 Pass a long as parameter to control what version of SSL/TLS to attempt to use.
1251 The available options are:
1253 .IP CURL_SSLVERSION_DEFAULT
1254 The default action. When libcurl built with OpenSSL or NSS, this will attempt
1255 to figure out the remote SSL protocol version. Unfortunately there are a lot of
1256 ancient and broken servers in use which cannot handle this technique and will
1257 fail to connect. When libcurl is built with GnuTLS, this will mean SSLv3.
1258 .IP CURL_SSLVERSION_TLSv1
1259 Force TLSv1
1260 .IP CURL_SSLVERSION_SSLv2
1261 Force SSLv2
1262 .IP CURL_SSLVERSION_SSLv3
1263 Force SSLv3
1265 .IP CURLOPT_SSL_VERIFYPEER
1266 Pass a long as parameter.
1268 This option determines whether curl verifies the authenticity of the
1269 peer's certificate.  A nonzero value means curl verifies; zero means it
1270 doesn't.  The default is nonzero, but before 7.10, it was zero.
1272 When negotiating an SSL connection, the server sends a certificate
1273 indicating its identity.  Curl verifies whether the certificate is
1274 authentic, i.e. that you can trust that the server is who the
1275 certificate says it is.  This trust is based on a chain of digital
1276 signatures, rooted in certification authority (CA) certificates you
1277 supply.  As of 7.10, curl installs a default bundle of CA certificates
1278 and you can specify alternate certificates with the
1279 \fICURLOPT_CAINFO\fP option or the \fICURLOPT_CAPATH\fP option.
1281 When \fICURLOPT_SSL_VERIFYPEER\fP is nonzero, and the verification
1282 fails to prove that the certificate is authentic, the connection
1283 fails.  When the option is zero, the connection succeeds regardless.
1285 Authenticating the certificate is not by itself very useful.  You
1286 typically want to ensure that the server, as authentically identified
1287 by its certificate, is the server you mean to be talking to.  Use
1288 \fICURLOPT_SSL_VERIFYHOST\fP to control that.
1289 .IP CURLOPT_CAINFO
1290 Pass a char * to a zero terminated string naming a file holding one or more
1291 certificates to verify the peer with.  This makes sense only when used in
1292 combination with the \fICURLOPT_SSL_VERIFYPEER\fP option.  If
1293 \fICURLOPT_SSL_VERIFYPEER\fP is zero, \fICURLOPT_CAINFO\fP need not
1294 even indicate an accessible file.
1296 Note that option is by default set to the system path where libcurl's cacert
1297 bundle is assumed to be stored, as established at build time.
1299 When built against NSS this is the directory that the NSS certificate
1300 database resides in.
1301 .IP CURLOPT_CAPATH
1302 Pass a char * to a zero terminated string naming a directory holding multiple
1303 CA certificates to verify the peer with. The certificate directory must be
1304 prepared using the openssl c_rehash utility. This makes sense only when used
1305 in combination with the \fICURLOPT_SSL_VERIFYPEER\fP option.  If
1306 \fICURLOPT_SSL_VERIFYPEER\fP is zero, \fICURLOPT_CAPATH\fP need not even
1307 indicate an accessible path.  The \fICURLOPT_CAPATH\fP function apparently
1308 does not work in Windows due to some limitation in openssl. This option is
1309 OpenSSL-specific and does nothing if libcurl is built to use GnuTLS.
1310 .IP CURLOPT_RANDOM_FILE
1311 Pass a char * to a zero terminated file name. The file will be used to read
1312 from to seed the random engine for SSL. The more random the specified file is,
1313 the more secure the SSL connection will become.
1314 .IP CURLOPT_EGDSOCKET
1315 Pass a char * to the zero terminated path name to the Entropy Gathering Daemon
1316 socket. It will be used to seed the random engine for SSL.
1317 .IP CURLOPT_SSL_VERIFYHOST
1318 Pass a long as parameter.
1320 This option determines whether libcurl verifies that the server cert is for
1321 the server it is known as.
1323 When negotiating an SSL connection, the server sends a certificate indicating
1324 its identity.
1326 When \fICURLOPT_SSL_VERIFYHOST\fP is 2, that certificate must indicate that
1327 the server is the server to which you meant to connect, or the connection
1328 fails.
1330 Curl considers the server the intended one when the Common Name field or a
1331 Subject Alternate Name field in the certificate matches the host name in the
1332 URL to which you told Curl to connect.
1334 When the value is 1, the certificate must contain a Common Name field, but it
1335 doesn't matter what name it says.  (This is not ordinarily a useful setting).
1337 When the value is 0, the connection succeeds regardless of the names in the
1338 certificate.
1340 The default, since 7.10, is 2.
1342 The checking this option controls is of the identity that the server
1343 \fIclaims\fP.  The server could be lying.  To control lying, see
1344 \fICURLOPT_SSL_VERIFYPEER\fP.
1345 .IP CURLOPT_SSL_CIPHER_LIST
1346 Pass a char *, pointing to a zero terminated string holding the list of
1347 ciphers to use for the SSL connection. The list must be syntactically correct,
1348 it consists of one or more cipher strings separated by colons. Commas or spaces
1349 are also acceptable separators but colons are normally used, \!, \- and \+ can
1350 be used as operators.
1352 For OpenSSL and GnuTLS valid examples of cipher lists include 'RC4-SHA',
1353 \'SHA1+DES\', 'TLSv1' and 'DEFAULT'. The default list is normally set when you
1354 compile OpenSSL.
1356 You'll find more details about cipher lists on this URL:
1357 \fIhttp://www.openssl.org/docs/apps/ciphers.html\fP
1359 For NSS valid examples of cipher lists include 'rsa_rc4_128_md5',
1360 \'rsa_aes_128_sha\', etc. With NSS you don't add/remove ciphers. If one uses
1361 this option then all known ciphers are disabled and only those passed in
1362 are enabled.
1364 You'll find more details about the NSS cipher lists on this URL:
1365 \fIhttp://directory.fedora.redhat.com/docs/mod_nss.html#Directives\fP
1367 .IP CURLOPT_SSL_SESSIONID_CACHE
1368 Pass a long set to 0 to disable libcurl's use of SSL session-ID caching. Set
1369 this to 1 to enable it. By default all transfers are done using the
1370 cache. Note that while nothing ever should get hurt by attempting to reuse SSL
1371 session-IDs, there seem to be broken SSL implementations in the wild that may
1372 require you to disable this in order for you to succeed. (Added in 7.16.0)
1373 .IP CURLOPT_KRBLEVEL
1374 Pass a char * as parameter. Set the kerberos security level for FTP; this
1375 also enables kerberos awareness.  This is a string, 'clear', 'safe',
1376 'confidential' or \&'private'.  If the string is set but doesn't match one
1377 of these, 'private' will be used. Set the string to NULL to disable kerberos
1378 support for FTP.
1380 (This option was known as CURLOPT_KRB4LEVEL up to 7.16.3)
1381 .SH SSH OPTIONS
1382 .IP CURLOPT_SSH_AUTH_TYPES
1383 Pass a long set to a bitmask consisting of one or more of
1384 CURLSSH_AUTH_PUBLICKEY, CURLSSH_AUTH_PASSWORD, CURLSSH_AUTH_HOST,
1385 CURLSSH_AUTH_KEYBOARD. Set CURLSSH_AUTH_ANY to let libcurl pick one.
1386 .IP CURLOPT_SSH_PUBLIC_KEYFILE
1387 Pass a char * pointing to a file name for your public key. If not used,
1388 libcurl defaults to using \fB~/.ssh/id_dsa.pub\fP.
1389 .IP CURLOPT_SSH_PRIVATE_KEYFILE
1390 Pass a char * pointing to a file name for your private key. If not used,
1391 libcurl defaults to using \fB~/.ssh/id_dsa\fP.
1392 If the file is password-protected, set the password with \fICURLOPT_SSLKEYPASSWD\fP.
1393 .SH OTHER OPTIONS
1394 .IP CURLOPT_PRIVATE
1395 Pass a char * as parameter, pointing to data that should be associated with
1396 this curl handle.  The pointer can subsequently be retrieved using
1397 \fIcurl_easy_getinfo(3)\fP with the CURLINFO_PRIVATE option. libcurl itself
1398 does nothing with this data. (Added in 7.10.3)
1399 .IP CURLOPT_SHARE
1400 Pass a share handle as a parameter. The share handle must have been created by
1401 a previous call to \fIcurl_share_init(3)\fP. Setting this option, will make
1402 this curl handle use the data from the shared handle instead of keeping the
1403 data to itself. This enables several curl handles to share data. If the curl
1404 handles are used simultaneously, you \fBMUST\fP use the locking methods in the
1405 share handle. See \fIcurl_share_setopt(3)\fP for details.
1406 .IP CURLOPT_NEW_FILE_PERMS
1407 Pass a long as a parameter, containing the value of the permissions that will
1408 be assigned to newly created files on the remote server.  The default value is
1409 \fI0644\fP, but any valid value can be used.  The only protocols that can use
1410 this are \fIsftp://\fP, \fIscp://\fP and \fIfile://\fP. (Added in 7.16.4)
1411 .IP CURLOPT_NEW_DIRECTORY_PERMS
1412 Pass a long as a parameter, containing the value of the permissions that will
1413 be assigned to newly created directories on the remote server.  The default
1414 value is \fI0755\fP, but any valid value can be used.  The only protocols that
1415 can use this are \fIsftp://\fP, \fIscp://\fP and \fIfile://\fP.
1416 (Added in 7.16.4)
1417 .SH TELNET OPTIONS
1418 .IP CURLOPT_TELNETOPTIONS
1419 Provide a pointer to a curl_slist with variables to pass to the telnet
1420 negotiations. The variables should be in the format <option=value>. libcurl
1421 supports the options 'TTYPE', 'XDISPLOC' and 'NEW_ENV'. See the TELNET
1422 standard for details.
1423 .SH RETURN VALUE
1424 CURLE_OK (zero) means that the option was set properly, non-zero means an
1425 error occurred as \fI<curl/curl.h>\fP defines. See the \fIlibcurl-errors(3)\fP
1426 man page for the full list with descriptions.
1428 If you try to set an option that libcurl doesn't know about, perhaps because
1429 the library is too old to support it or the option was removed in a recent
1430 version, this function will return \fICURLE_FAILED_INIT\fP.
1431 .SH "SEE ALSO"
1432 .BR curl_easy_init "(3), " curl_easy_cleanup "(3), " curl_easy_reset "(3), "