]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/curl/docs/libcurl/curl_easy_setopt.3
hello world
[icculus/iodoom3.git] / neo / curl / docs / libcurl / curl_easy_setopt.3
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2004, 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.82 2004/03/12 09:14:45 bagder Exp $
22 .\" **************************************************************************
23 .\"
24 .TH curl_easy_setopt 3 "12 Mar 2004" "libcurl 7.11.1" "libcurl Manual"
25 .SH NAME
26 curl_easy_setopt - set options for a curl easy handle
27 .SH SYNOPSIS
28 #include <curl/curl.h>
29
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 long, a function pointer or an object
36 pointer, all depending on what the specific option expects. Read this manual
37 carefully as bad input values may cause libcurl to behave badly!  You can only
38 set one option in each function call. A typical application uses many
39 curl_easy_setopt() calls in the setup phase.
40
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.
45
46 \fBNOTE:\fP strings passed to libcurl as 'char *' arguments, will not be
47 copied by the library. Instead you should keep them available until libcurl no
48 longer needs them. Failing to do so will cause very odd behavior or even
49 crashes. libcurl will need them until you call \fIcurl_easy_cleanup(3)\fP or
50 you set the same option again to use a different pointer.
51
52 The \fIhandle\fP is the return code from a \fIcurl_easy_init(3)\fP or
53 \fIcurl_easy_duphandle(3)\fP call.
54 .SH BEHAVIOR OPTIONS
55 .IP CURLOPT_VERBOSE
56 Set the parameter to non-zero to get the library to display a lot of verbose
57 information about its operations. Very useful for libcurl and/or protocol
58 debugging and understanding. The verbose information will be sent to stderr,
59 or the stream set with \fICURLOPT_STDERR\fP.
60
61 You hardly ever want this set in production use, you will almost always want
62 this when you debug/report problems. Another neat option for debugging is the
63 \fICURLOPT_DEBUGFUNCTION\fP.
64 .IP CURLOPT_HEADER
65 A non-zero parameter tells the library to include the header in the body
66 output. This is only relevant for protocols that actually have headers
67 preceding the data (like HTTP).
68 .IP CURLOPT_NOPROGRESS
69 A non-zero parameter tells the library to shut off the built-in progress meter
70 completely.
71
72 \fBNOTE:\fP future versions of libcurl is likely to not have any built-in
73 progress meter at all.
74 .IP CURLOPT_NOSIGNAL
75 Pass a long. If it is non-zero, libcurl will not use any functions that
76 install signal handlers or any functions that cause signals to be sent to the
77 process. This option is mainly here to allow multi-threaded unix applications
78 to still set/use all timeout options etc, without risking getting signals.
79 (Added in 7.10)
80
81 Consider building libcurl with ares support to enable asynchronous DNS
82 lookups. It enables nice timeouts for name resolves without signals.
83 .PP
84 .SH CALLBACK OPTIONS
85 .IP CURLOPT_WRITEFUNCTION
86 Function pointer that should match the following prototype: \fBsize_t
87 function( void *ptr, size_t size, size_t nmemb, void *stream);\fP This
88 function gets called by libcurl as soon as there is data reveiced that needs
89 to be saved. The size of the data pointed to by \fIptr\fP is \fIsize\fP
90 multiplied with \fInmemb\fP, it will not be zero terminated. Return the number
91 of bytes actually taken care of. If that amount differs from the amount passed
92 to your function, it'll signal an error to the library and it will abort the
93 transfer and return \fICURLE_WRITE_ERROR\fP.
94
95 Set the \fIstream\fP argument with the \fICURLOPT_WRITEDATA\fP option.
96
97 \fBNOTE:\fP you will be passed as much data as possible in all invokes, but
98 you cannot possibly make any assumptions. It may be one byte, it may be
99 thousands. The maximum amount of data that can be passed to the write callback
100 is defined in the curl.h header file: CURL_MAX_WRITE_SIZE.
101 .IP CURLOPT_WRITEDATA
102 Data pointer to pass to the file write function. Note that if you specify the
103 \fICURLOPT_WRITEFUNCTION\fP, this is the pointer you'll get as input. If you
104 don't use a callback, you must pass a 'FILE *' as libcurl will pass this to
105 fwrite() when writing data.
106
107 \fBNOTE:\fP If you're using libcurl as a win32 DLL, you MUST use the
108 \fICURLOPT_WRITEFUNCTION\fP if you set this option or you will experience
109 crashes.
110
111 This option is also known with the older name \fICURLOPT_FILE\fP, the name
112 \fICURLOPT_WRITEDATA\fP was introduced in 7.9.7.
113 .IP CURLOPT_READFUNCTION
114 Function pointer that should match the following prototype: \fBsize_t
115 function( void *ptr, size_t size, size_t nmemb, void *stream);\fP This
116 function gets called by libcurl as soon as it needs to read data in order to
117 send it to the peer. The data area pointed at by the pointer \fIptr\fP may be
118 filled with at most \fIsize\fP multiplied with \fInmemb\fP number of
119 bytes. Your function must return the actual number of bytes that you stored in
120 that memory area. Returning 0 will signal end-of-file to the library and cause
121 it to stop the current transfer.
122 .IP CURLOPT_READDATA
123 Data pointer to pass to the file read function. Note that if you specify the
124 \fICURLOPT_READFUNCTION\fP, this is the pointer you'll get as input. If you
125 don't specify a read callback, this must be a valid FILE *.
126
127 \fBNOTE:\fP If you're using libcurl as a win32 DLL, you MUST use a
128 \fICURLOPT_READFUNCTION\fP if you set this option.
129
130 This option is also known with the older name \fICURLOPT_INFILE\fP, the name
131 \fICURLOPT_READDATA\fP was introduced in 7.9.7.
132 .IP CURLOPT_PROGRESSFUNCTION
133 Function pointer that should match the \fIcurl_progress_callback\fP prototype
134 found in \fI<curl/curl.h>\fP. This function gets called by libcurl instead of
135 its internal equivalent with a frequent interval during data transfer.
136 Unknown/unused argument values will be set to zero (like if you only download
137 data, the upload size will remain 0). Returning a non-zero value from this
138 callback will cause libcurl to abort the transfer and return
139 \fICURLE_ABORTED_BY_CALLBACK\fP.
140
141 Also note that \fICURLOPT_NOPROGRESS\fP must be set to FALSE to make this
142 function actually get called.
143 .IP CURLOPT_PROGRESSDATA
144 Pass a pointer that will be untouched by libcurl and passed as the first
145 argument in the progress callback set with \fICURLOPT_PROGRESSFUNCTION\fP.
146 .IP CURLOPT_HEADERFUNCTION
147 Function pointer that should match the following prototype: \fIsize_t
148 function( void *ptr, size_t size, size_t nmemb, void *stream);\fP. This
149 function gets called by libcurl as soon as there is received header data that
150 needs to be written down. The headers are guaranteed to be written one-by-one
151 and only complete lines are written. Parsing headers should be easy enough
152 using this. The size of the data pointed to by \fIptr\fP is \fIsize\fP
153 multiplied with \fInmemb\fP.  The pointer named \fIstream\fP will be the one
154 you passed to libcurl with the \fICURLOPT_WRITEHEADER\fP option.  Return the
155 number of bytes actually written or return -1 to signal error to the library
156 (it will cause it to abort the transfer with a \fICURLE_WRITE_ERROR\fP return
157 code).
158 .IP CURLOPT_WRITEHEADER
159 Pass a pointer to be used to write the header part of the received data to. If
160 you don't use your own callback to take care of the writing, this must be a
161 valid FILE *. See also the \fICURLOPT_HEADERFUNCTION\fP option above on how to
162 set a custom get-all-headers callback.
163 .IP CURLOPT_DEBUGFUNCTION
164 Function pointer that should match the following prototype: \fIint
165 curl_debug_callback (CURL *, curl_infotype, char *, size_t, void *);\fP
166 \fICURLOPT_DEBUGFUNCTION\fP replaces the standard debug function used when
167 \fICURLOPT_VERBOSE \fP is in effect. This callback receives debug information,
168 as specified with the \fBcurl_infotype\fP argument. This funtion must return
169 0.  The data pointed to by the char * passed to this function WILL NOT be zero
170 terminated, but will be exactly of the size as told by the size_t argument.
171
172 Available curl_infotype values:
173 .RS
174 .IP CURLINFO_TEXT
175 The data is informational text.
176 .IP CURLINFO_HEADER_IN
177 The data is header (or header-like) data received from the peer.
178 .IP CURLINFO_HEADER_OUT
179 The data is header (or header-like) data sent to the peer.
180 .IP CURLINFO_DATA_IN
181 The data is protocol data received from the peer.
182 .IP CURLINFO_DATA_OUT
183 The data is protocol data sent to the peer.
184 .RE
185 .IP CURLOPT_DEBUGDATA
186 Pass a pointer to whatever you want passed in to your
187 \fICURLOPT_DEBUGFUNCTION\fP in the last void * argument. This pointer is not
188 used by libcurl, it is only passed to the callback.
189 .IP CURLOPT_SSL_CTX_FUNCTION
190 Function pointer that should match the following prototype: \fBCURLcode
191 sslctxfun(CURL *curl, void *sslctx, void *parm);\fP This function gets called
192 by libcurl just before the initialization of an SSL connection after having
193 processed all other SSL related options to give a last chance to an
194 application to modify the behaviour of openssl's ssl initilaization. The
195 \fIsslctx\fP parameter is actually a pointer to an openssl \fISSL_CTX\fP. If
196 an error is returned no attempt to establish a connection is made and the
197 perform operation will return the error code from this callback function.  Set
198 the \fIparm\fP argument with the \fICURLOPT_SSL_CTX_DATA\fP option. This
199 option was introduced in 7.11.0.
200
201 \fBNOTE:\fP To use this properly, a non-trivial amount of knowledge of the
202 openssl libraries is necessary. Using this function allows for example to use
203 openssl callbacks to add additional validation code for certificates, and even
204 to change the actual URI of an HTTPS request (example used in the lib509 test
205 case).  See also the example section for a replacement of the key, certificate
206 and trust file settings.
207 .IP CURLOPT_SSL_CTX_DATA
208 Data pointer to pass to the ssl context callback set by the option
209 \fICURLOPT_SSL_CTX_FUNCTION\fP, this is the pointer you'll get as third
210 parameter, otherwise \fBNULL\fP. (Added in 7.11.0)
211 .SH ERROR OPTIONS
212 .IP CURLOPT_ERRORBUFFER
213 Pass a char * to a buffer that the libcurl may store human readable error
214 messages in. This may be more helpful than just the return code from the
215 library. The buffer must be at least CURL_ERROR_SIZE big.
216
217 Use \fICURLOPT_VERBOSE\fP and \fICURLOPT_DEBUGFUNCTION\fP to better
218 debug/trace why errors happen.
219
220 \fBNote:\fP if the library does not return an error, the buffer may not have
221 been touched. Do not rely on the contents in those cases.
222 .IP CURLOPT_STDERR
223 Pass a FILE * as parameter. Tell libcurl to use this stream instead of stderr
224 when showing the progress meter and displaying \fICURLOPT_VERBOSE\fP data.
225 .IP CURLOPT_FAILONERROR
226 A non-zero parameter tells the library to fail silently if the HTTP code
227 returned is equal to or larger than 300. The default action would be to return
228 the page normally, ignoring that code.
229 .SH NETWORK OPTIONS
230 .IP CURLOPT_URL
231 The actual URL to deal with. The parameter should be a char * to a zero
232 terminated string. The string must remain present until curl no longer needs
233 it, as it doesn't copy the string.
234
235 If the given URL lacks the protocol part ("http://" or "ftp://" etc), it will
236 attempt to guess which protocol to use based on the given host name. If the
237 given protocol of the set URL is not supported, libcurl will return on error
238 (\fICURLE_UNSUPPORTED_PROTOCOL\fP) when you call \fIcurl_easy_perform(3)\fP or
239 \fIcurl_multi_perform(3)\fP. Use \fIcurl_version_info(3)\fP for detailed info
240 on which protocols that are supported.
241
242 \fBNOTE:\fP \fICURLOPT_URL\fP is the only option that must be set before
243 \fIcurl_easy_perform(3)\fP is called.
244 .IP CURLOPT_PROXY
245 Set HTTP proxy to use. The parameter should be a char * to a zero terminated
246 string holding the host name or dotted IP address. To specify port number in
247 this string, append :[port] to the end of the host name. The proxy string may
248 be prefixed with [protocol]:// since any such prefix will be ignored. The
249 proxy's port number may optionally be specified with the separate option
250 \fICURLOPT_PROXYPORT\fP.
251
252 \fBNOTE:\fP when you tell the library to use a HTTP proxy, libcurl will
253 transparently convert operations to HTTP even if you specify a FTP URL
254 etc. This may have an impact on what other features of the library you can
255 use, such as \fICURLOPT_QUOTE\fP and similar FTP specifics that don't work
256 unless you tunnel through the HTTP proxy. Such tunneling is activated with
257 \fICURLOPT_HTTPPROXYTUNNEL\fP.
258
259 \fBNOTE2:\fP libcurl respects the environment variables \fBhttp_proxy\fP,
260 \fBftp_proxy\fP, \fBall_proxy\fP etc, if any of those is set.
261 .IP CURLOPT_PROXYPORT
262 Pass a long with this option to set the proxy port to connect to unless it is
263 specified in the proxy string \fICURLOPT_PROXY\fP.
264 .IP CURLOPT_PROXYTYPE
265 Pass a long with this option to set type of the proxy. Available options for
266 this are \fICURLPROXY_HTTP\fP and \fICURLPROXY_SOCKS5\fP, with the HTTP one
267 being default. (Added in 7.10)
268 .IP CURLOPT_HTTPPROXYTUNNEL
269 Set the parameter to non-zero to get the library to tunnel all operations
270 through a given HTTP proxy. Note that there is a big difference between using
271 a proxy and to tunnel through it. If you don't know what this means, you
272 probably don't want this tunneling option.
273 .IP CURLOPT_INTERFACE
274 Pass a char * as parameter. This set the interface name to use as outgoing
275 network interface. The name can be an interface name, an IP address or a host
276 name.
277 .IP CURLOPT_DNS_CACHE_TIMEOUT
278 Pass a long, this sets the timeout in seconds. Name resolves will be kept in
279 memory for this number of seconds. Set to zero (0) to completely disable
280 caching, or set to -1 to make the cached entries remain forever. By default,
281 libcurl caches this info for 60 seconds.
282 .IP CURLOPT_DNS_USE_GLOBAL_CACHE
283 Pass a long. If the value is non-zero, it tells curl to use a global DNS cache
284 that will survive between easy handle creations and deletions. This is not
285 thread-safe and this will use a global varible.
286
287 \fBWARNING:\fP this option is considered obsolete. Stop using it. Switch over
288 to using the share interface instead! See \fICURLOPT_SHARE\fP and
289 \fIcurl_share_init(3)\fP.
290 .IP CURLOPT_BUFFERSIZE
291 Pass a long specifying your prefered size for the receive buffer in libcurl.
292 The main point of this would be that the write callback gets called more often
293 and with smaller chunks. This is just treated as a request, not an order. You
294 cannot be guaranteed to actually get the given size. (Added in 7.10)
295 .IP CURLOPT_PORT
296 Pass a long specifying what remote port number to connect to, instead of the
297 one specified in the URL or the default port for the used protocol.
298 .SH NAMES and PASSWORDS OPTIONS (Authentication)
299 .IP CURLOPT_NETRC
300 This parameter controls the preference of libcurl between using user names and
301 passwords from your \fI~/.netrc\fP file, relative to user names and passwords
302 in the URL supplied with \fICURLOPT_URL\fP.
303
304 \fBNote:\fP libcurl uses a user name (and supplied or prompted password)
305 supplied with \fICURLOPT_USERPWD\fP in preference to any of the options
306 controlled by this parameter.
307
308 Pass a long, set to one of the values described below.
309 .RS
310 .IP CURL_NETRC_OPTIONAL
311 The use of your \fI~/.netrc\fP file is optional,
312 and information in the URL is to be preferred.  The file will be scanned
313 with the host and user name (to find the password only) or with the host only,
314 to find the first user name and password after that \fImachine\fP,
315 which ever information is not specified in the URL.
316
317 Undefined values of the option will have this effect.
318 .IP CURL_NETRC_IGNORED
319 The library will ignore the file and use only the information in the URL.
320
321 This is the default.
322 .IP CURL_NETRC_REQUIRED
323 This value tells the library that use of the file is required,
324 to ignore the information in the URL,
325 and to search the file with the host only.
326 .RE
327 Only machine name, user name and password are taken into account 
328 (init macros and similar things aren't supported).
329
330 \fBNote:\fP libcurl does not verify that the file has the correct properties
331 set (as the standard Unix ftp client does). It should only be readable by
332 user.
333 .IP CURLOPT_NETRC_FILE
334 Pass a char * as parameter, pointing to a zero terminated string containing
335 the full path name to the file you want libcurl to use as .netrc file. If this
336 option is omitted, and \fICURLOPT_NETRC\fP is set, libcurl will attempt to
337 find the a .netrc file in the current user's home directory. (Added in 7.10.9)
338 .IP CURLOPT_USERPWD
339 Pass a char * as parameter, which should be [user name]:[password] to use for
340 the connection. Use \fICURLOPT_HTTPAUTH\fP to decide authentication method.
341
342 When using HTTP and \fICURLOPT_FOLLOWLOCATION\fP, libcurl might perform
343 several requests to possibly different hosts. libcurl will only send this user
344 and password information to hosts using the initial host name (unless
345 \fICURLOPT_UNRESTRICTED_AUTH\fP is set), so if libcurl follows locations to
346 other hosts it will not send the user and password to those. This is enforced
347 to prevent accidental information leakage.
348 .IP CURLOPT_PROXYUSERPWD
349 Pass a char * as parameter, which should be [user name]:[password] to use for
350 the connection to the HTTP proxy.  Use \fICURLOPT_PROXYAUTH\fP to decide
351 authentication method.
352 .IP CURLOPT_HTTPAUTH
353 Pass a long as parameter, which is set to a bitmask, to tell libcurl what
354 authentication method(s) you want it to use. The available bits are listed
355 below. If more than one bit is set, libcurl will first query the site to see
356 what authentication methods it supports and then pick the best one you allow
357 it to use. Note that for some methods, this will induce an extra network
358 round-trip. Set the actual name and password with the \fICURLOPT_USERPWD\fP
359 option. (Added in 7.10.6)
360 .RS
361 .IP CURLAUTH_BASIC
362 HTTP Basic authentication. This is the default choice, and the only method
363 that is in wide-spread use and supported virtually everywhere. This is sending
364 the user name and password over the network in plain text, easily captured by
365 others.
366 .IP CURLAUTH_DIGEST
367 HTTP Digest authentication.  Digest authentication is defined in RFC2617 and
368 is a more secure way to do authentication over public networks than the
369 regular old-fashioned Basic method.
370 .IP CURLAUTH_GSSNEGOTIATE
371 HTTP GSS-Negotiate authentication. The GSS-Negotiate (also known as plain
372 "Negotiate") method was designed by Microsoft and is used in their web
373 aplications. It is primarily meant as a support for Kerberos5 authentication
374 but may be also used along with another authentication methods. For more
375 information see IETF draft draft-brezak-spnego-http-04.txt.
376
377 \fBNOTE\fP that you need to build libcurl with a suitable GSS-API library for
378 this to work.
379 .IP CURLAUTH_NTLM
380 HTTP NTLM authentication. A proprietary protocol invented and used by
381 Microsoft. It uses a challenge-response and hash concept similar to Digest, to
382 prevent the password from being evesdropped.
383
384 \fBNOTE\fP that you need to build libcurl with SSL support for this option to
385 work.
386 .IP CURLAUTH_ANY
387 This is a convenience macro that sets all bits and thus makes libcurl pick any
388 it finds suitable. libcurl will automaticly select the one it finds most
389 secure.
390 .IP CURLAUTH_ANYSAFE
391 This is a convenience macro that sets all bits except Basic and thus makes
392 libcurl pick any it finds suitable. libcurl will automaticly select the one it
393 finds most secure.
394 .RE
395 .IP CURLOPT_PROXYAUTH
396 Pass a long as parameter, which is set to a bitmask, to tell libcurl what
397 authentication method(s) you want it to use for your proxy authentication.  If
398 more than one bit is set, libcurl will first query the site to see what
399 authentication methods it supports and then pick the best one you allow it to
400 use. Note that for some methods, this will induce an extra network
401 round-trip. Set the actual name and password with the
402 \fICURLOPT_PROXYUSERPWD\fP option. The bitmask can be constructed by or'ing
403 together the bits listed above for the \fICURLOPT_HTTPAUTH\fP option. As of
404 this writing, only Basic and NTLM work. (Added in 7.10.7)
405 .SH HTTP OPTIONS
406 .IP CURLOPT_AUTOREFERER
407 Pass a non-zero parameter to enable this. When enabled, libcurl will
408 automaticly set the Referer: field in requests where it follows a Location:
409 redirect.
410 .IP CURLOPT_ENCODING
411 Sets the contents of the Accept-Encoding: header sent in an HTTP
412 request, and enables decoding of a response when a Content-Encoding:
413 header is received.  Three encodings are supported: \fIidentity\fP,
414 which does nothing, \fIdeflate\fP which requests the server to
415 compress its response using the zlib algorithm, and \fIgzip\fP which
416 requests the gzip algorithm.  If a zero-length string is set, then an
417 Accept-Encoding: header containing all supported encodings is sent.
418
419 This is a request, not an order; the server may or may not do it.  This
420 option must be set (to any non-NULL value) or else any unsolicited
421 encoding done by the server is ignored. See the special file
422 lib/README.encoding for details.
423 .IP CURLOPT_FOLLOWLOCATION
424 A non-zero parameter tells the library to follow any Location: header that the
425 server sends as part of a HTTP header.
426
427 \fBNOTE:\fP this means that the library will re-send the same request on the
428 new location and follow new Location: headers all the way until no more such
429 headers are returned. \fICURLOPT_MAXREDIRS\fP can be used to limit the number
430 of redirects libcurl will follow.
431 .IP CURLOPT_UNRESTRICTED_AUTH
432 A non-zero parameter tells the library it can continue to send authentication
433 (user+password) when following locations, even when hostname changed. Note
434 that this is meaningful only when setting \fICURLOPT_FOLLOWLOCATION\fP.
435 .IP CURLOPT_MAXREDIRS
436 Pass a long. The set number will be the redirection limit. If that many
437 redirections have been followed, the next redirect will cause an error
438 (\fICURLE_TOO_MANY_REDIRECTS\fP). This option only makes sense if the
439 \fICURLOPT_FOLLOWLOCATION\fP is used at the same time.
440 .IP CURLOPT_PUT
441 A non-zero parameter tells the library to use HTTP PUT to transfer data. The
442 data should be set with \fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE\fP.
443 .IP CURLOPT_POST
444 A non-zero parameter tells the library to do a regular HTTP post. This is a
445 normal application/x-www-form-urlencoded kind, which is the most commonly used
446 one by HTML forms. See the \fICURLOPT_POSTFIELDS\fP option for how to specify
447 the data to post and \fICURLOPT_POSTFIELDSIZE\fP in how to set the data
448 size. Using the \fICURLOPT_POSTFIELDS\fP option implies this option.
449 .IP CURLOPT_POSTFIELDS
450 Pass a char * as parameter, which should be the full data to post in a HTTP
451 post operation. You need to make sure that the data is formatted the way you
452 want the server to receive it. libcurl will not convert or encode it for
453 you. Most web servers will assume this data to be url-encoded. Take note.
454
455 This POST is a normal application/x-www-form-urlencoded kind (and libcurl will
456 set that Content-Type by default when this option is used), which is the most
457 commonly used one by HTML forms. See also the \fICURLOPT_POST\fP. Using
458 \fICURLOPT_POSTFIELDS\fP implies \fICURLOPT_POST\fP.
459
460 \fBNote:\fP to make multipart/formdata posts (aka rfc1867-posts), check out
461 the \fICURLOPT_HTTPPOST\fP option.
462 .IP CURLOPT_POSTFIELDSIZE
463 If you want to post data to the server without letting libcurl do a strlen()
464 to measure the data size, this option must be used. When this option is used
465 you can post fully binary data, which otherwise is likely to fail. If this
466 size is set to zero, the library will use strlen() to get the size.
467 .IP CURLOPT_POSTFIELDSIZE_LARGE
468 Pass a curl_off_t as parameter. Use this to set the size of the
469 \fICURLOPT_POSTFIELDS\fP data to prevent libcurl from doing strlen() on the
470 data to figure out the size. This is the large file version of the
471 \fICURLOPT_POSTFIELDSIZE\fP option. (Added in 7.11.1)
472 .IP CURLOPT_HTTPPOST
473 Tells libcurl you want a multipart/formdata HTTP POST to be made and you
474 instruct what data to pass on to the server.  Pass a pointer to a linked list
475 of HTTP post structs as parameter.  The linked list should be a fully valid
476 list of 'struct HttpPost' structs properly filled in. The best and most
477 elegant way to do this, is to use \fIcurl_formadd(3)\fP as documented. The
478 data in this list must remain intact until you close this curl handle again
479 with \fIcurl_easy_cleanup(3)\fP.
480 .IP CURLOPT_REFERER
481 Pass a pointer to a zero terminated string as parameter. It will be used to
482 set the Referer: header in the http request sent to the remote server. This
483 can be used to fool servers or scripts. You can also set any custom header
484 with \fICURLOPT_HTTPHEADER\fP.
485 .IP CURLOPT_USERAGENT
486 Pass a pointer to a zero terminated string as parameter. It will be used to
487 set the User-Agent: header in the http request sent to the remote server. This
488 can be used to fool servers or scripts. You can also set any custom header
489 with \fICURLOPT_HTTPHEADER\fP.
490 .IP CURLOPT_HTTPHEADER
491 Pass a pointer to a linked list of HTTP headers to pass to the server in your
492 HTTP request. The linked list should be a fully valid list of \fBstruct
493 curl_slist\fP structs properly filled in. Use \fIcurl_slist_append(3)\fP to
494 create the list and \fIcurl_slist_free_all(3)\fP to clean up an entire
495 list. If you add a header that is otherwise generated and used by libcurl
496 internally, your added one will be used instead. If you add a header with no
497 contents as in 'Accept:' (no data on the right side of the colon), the
498 internally used header will get disabled. Thus, using this option you can add
499 new headers, replace internal headers and remove internal headers. The
500 headers included in the linked list must not be CRLF-terminated, because
501 curl adds CRLF after each header item. Failure to comply with this will
502 result in strange bugs because the server will most likely ignore part
503 of the headers you specified.
504
505 The first line in a request (usually containing a GET or POST) is not a header
506 and cannot be replaced using this option. Only the lines following the
507 request-line are headers.
508
509 \fBNOTE:\fPThe most commonly replaced headers have "shortcuts" in the options
510 \fICURLOPT_COOKIE\fP, \fICURLOPT_USERAGENT\fP and \fICURLOPT_REFERER\fP.
511 .IP CURLOPT_HTTP200ALIASES
512 Pass a pointer to a linked list of aliases to be treated as valid HTTP 200
513 responses.  Some servers respond with a custom header response line.  For
514 example, IceCast servers respond with "ICY 200 OK".  By including this string
515 in your list of aliases, the response will be treated as a valid HTTP header
516 line such as "HTTP/1.0 200 OK". (Added in 7.10.3)
517
518 The linked list should be a fully valid list of struct curl_slist structs, and
519 be properly filled in.  Use \fIcurl_slist_append(3)\fP to create the list and
520 \fIcurl_slist_free_all(3)\fP to clean up an entire list.
521
522 \fBNOTE:\fPThe alias itself is not parsed for any version strings.  So if your
523 alias is "MYHTTP/9.9", Libcurl will not treat the server as responding with
524 HTTP version 9.9.  Instead Libcurl will use the value set by option
525 \fICURLOPT_HTTP_VERSION\fP.
526 .IP CURLOPT_COOKIE
527 Pass a pointer to a zero terminated string as parameter. It will be used to
528 set a cookie in the http request. The format of the string should be
529 NAME=CONTENTS, where NAME is the cookie name and CONTENTS is what the cookie
530 should contain.
531
532 If you need to set mulitple cookies, you need to set them all using a single
533 option and thus you need to concat them all in one single string. Set multiple
534 cookies in one string like this: "name1=content1; name2=content2;" etc.
535
536 Using this option multiple times will only make the latest string override the
537 previously ones.
538 .IP CURLOPT_COOKIEFILE
539 Pass a pointer to a zero terminated string as parameter. It should contain the
540 name of your file holding cookie data to read. The cookie data may be in
541 Netscape / Mozilla cookie data format or just regular HTTP-style headers
542 dumped to a file.
543
544 Given an empty or non-existing file, this option will enable cookies for this
545 curl handle, making it understand and parse received cookies and then use
546 matching cookies in future request.
547 .IP CURLOPT_COOKIEJAR
548 Pass a file name as char *, zero terminated. This will make libcurl write all
549 internally known cookies to the specified file when \fIcurl_easy_cleanup(3)\fP
550 is called. If no cookies are known, no file will be created. Specify "-" to
551 instead have the cookies written to stdout. Using this option also enables
552 cookies for this session, so if you for example follow a location it will make
553 matching cookies get sent accordingly.
554
555 \fBNOTE:\fP If the cookie jar file can't be created or written to (when the
556 \fIcurl_easy_cleanup(3)\fP is called), libcurl will not and cannot report an
557 error for this. Using \fICURLOPT_VERBOSE\fP or \fICURLOPT_DEBUGFUNCTION\fP
558 will get a warning to display, but that is the only visible feedback you get
559 about this possibly lethal situation.
560 .IP CURLOPT_COOKIESESSION
561 Pass a long set to non-zero to mark this as a new cookie "session". It will
562 force libcurl to ignore all cookies it is about to load that are "session
563 cookies" from the previous session. By default, libcurl always stores and
564 loads all cookies, independent if they are session cookies are not. Session
565 cookies are cookies without expiry date and they are meant to be alive and
566 existing for this "session" only.
567 .IP CURLOPT_HTTPGET
568 Pass a long. If the long is non-zero, this forces the HTTP request to get back
569 to GET. Only really usable if POST, PUT or a custom request have been used
570 previously using the same curl handle.
571 .IP CURLOPT_HTTP_VERSION
572 Pass a long, set to one of the values described below. They force libcurl to
573 use the specific HTTP versions. This is not sensible to do unless you have a
574 good reason.
575 .RS
576 .IP CURL_HTTP_VERSION_NONE
577 We don't care about what version the library uses. libcurl will use whatever
578 it thinks fit.
579 .IP CURL_HTTP_VERSION_1_0
580 Enforce HTTP 1.0 requests.
581 .IP CURL_HTTP_VERSION_1_1
582 Enforce HTTP 1.1 requests.
583 .RE
584 .SH FTP OPTIONS
585 .IP CURLOPT_FTPPORT
586 Pass a pointer to a zero terminated string as parameter. It will be used to
587 get the IP address to use for the ftp PORT instruction. The PORT instruction
588 tells the remote server to connect to our specified IP address. The string may
589 be a plain IP address, a host name, an network interface name (under Unix) or
590 just a '-' letter to let the library use your systems default IP
591 address. Default FTP operations are passive, and thus won't use PORT.
592
593 You disable PORT again and go back to using the passive version by setting
594 this option to NULL.
595 .IP CURLOPT_QUOTE
596 Pass a pointer to a linked list of FTP commands to pass to the server prior to
597 your ftp request. This will be done before any other FTP commands are issued
598 (even before the CWD command). The linked list should be a fully valid list of
599 'struct curl_slist' structs properly filled in. Use \fIcurl_slist_append(3)\fP
600 to append strings (commands) to the list, and clear the entire list afterwards
601 with \fIcurl_slist_free_all(3)\fP. Disable this operation again by setting a
602 NULL to this option.
603 .IP CURLOPT_POSTQUOTE
604 Pass a pointer to a linked list of FTP commands to pass to the server after
605 your ftp transfer request. The linked list should be a fully valid list of
606 struct curl_slist structs properly filled in as described for
607 \fICURLOPT_QUOTE\fP. Disable this operation again by setting a NULL to this
608 option.
609 .IP CURLOPT_PREQUOTE
610 Pass a pointer to a linked list of FTP commands to pass to the server after
611 the transfer type is set. The linked list should be a fully valid list of
612 struct curl_slist structs properly filled in as described for
613 \fICURLOPT_QUOTE\fP. Disable this operation again by setting a NULL to this
614 option.
615 .IP CURLOPT_FTPLISTONLY
616 A non-zero parameter tells the library to just list the names of an ftp
617 directory, instead of doing a full directory listing that would include file
618 sizes, dates etc.
619
620 This causes an FTP NLST command to be sent.  Beware that some FTP servers list
621 only files in their response to NLST; they might not include subdirectories
622 and symbolic links.
623 .IP CURLOPT_FTPAPPEND
624 A non-zero parameter tells the library to append to the remote file instead of
625 overwrite it. This is only useful when uploading to a ftp site.
626 .IP CURLOPT_FTP_USE_EPRT
627 Pass a long. If the value is non-zero, it tells curl to use the EPRT (and
628 LPRT) command when doing active FTP downloads (which is enabled by
629 \fICURLOPT_FTPPORT\fP). Using EPRT means that it will first attempt to use
630 EPRT and then LPRT before using PORT, but if you pass FALSE (zero) to this
631 option, it will not try using EPRT or LPRT, only plain PORT. (Added in 7.10.5)
632 .IP CURLOPT_FTP_USE_EPSV
633 Pass a long. If the value is non-zero, it tells curl to use the EPSV command
634 when doing passive FTP downloads (which it always does by default). Using EPSV
635 means that it will first attempt to use EPSV before using PASV, but if you
636 pass FALSE (zero) to this option, it will not try using EPSV, only plain PASV.
637 .IP CURLOPT_FTP_CREATE_MISSING_DIRS
638 Pass a long. If the value is non-zero, curl will attempt to create any remote
639 directory that it fails to CWD into. CWD is the command that changes working
640 directory. (Added in 7.10.7)
641 .IP CURLOPT_FTP_RESPONSE_TIMEOUT
642 Pass a long.  Causes curl to set a timeout period (in seconds) on the amount
643 of time that the server is allowed to take in order to generate a response
644 message for a command before the session is considered hung.  Note that while
645 curl is waiting for a response, this value overrides \fICURLOPT_TIMEOUT\fP. It
646 is recommended that if used in conjunction with \fICURLOPT_TIMEOUT\fP, you set
647 \fICURLOPT_FTP_RESPONSE_TIMEOUT\fP to a value smaller than
648 \fICURLOPT_TIMEOUT\fP.  (Added in 7.10.8)
649 .IP CURLOPT_FTP_SSL
650 Pass a long using one of the values from below, to make libcurl use your
651 desired level of SSL for the ftp transfer. (Added in 7.11.0)
652 .RS
653 .IP CURLFTPSSL_NONE
654 Don't attempt to use SSL.
655 .IP CURLFTPSSL_TRY
656 Try using SSL, proceed as normal otherwise.
657 .IP CURLFTPSSL_CONTROL
658 Require SSL for the control connection or fail with \fICURLE_FTP_SSL_FAILED\fP.
659 .IP CURLFTPSSL_ALL
660 Require SSL for all communication or fail with \fICURLE_FTP_SSL_FAILED\fP.
661 .RE
662 .SH PROTOCOL OPTIONS
663 .IP CURLOPT_TRANSFERTEXT
664 A non-zero parameter tells the library to use ASCII mode for ftp transfers,
665 instead of the default binary transfer. For LDAP transfers it gets the data in
666 plain text instead of HTML and for win32 systems it does not set the stdout to
667 binary mode. This option can be usable when transferring text data between
668 systems with different views on certain characters, such as newlines or
669 similar.
670 .IP CURLOPT_CRLF
671 Convert Unix newlines to CRLF newlines on transfers.
672 .IP CURLOPT_RANGE
673 Pass a char * as parameter, which should contain the specified range you
674 want. It should be in the format "X-Y", where X or Y may be left out. HTTP
675 transfers also support several intervals, separated with commas as in
676 \fI"X-Y,N-M"\fP. Using this kind of multiple intervals will cause the HTTP
677 server to send the response document in pieces (using standard MIME separation
678 techniques).
679 .IP CURLOPT_RESUME_FROM
680 Pass a long as parameter. It contains the offset in number of bytes that you
681 want the transfer to start from.
682 .IP CURLOPT_RESUME_FROM_LARGE
683 Pass an curl_off_t as parameter. It contains the offset in number of bytes
684 that you want the transfer to start from. (Added in 7.11.0)
685 .IP CURLOPT_CUSTOMREQUEST
686 Pass a pointer to a zero terminated string as parameter. It will be user
687 instead of GET or HEAD when doing a HTTP request, or instead of LIST or NLST
688 when doing an ftp directory listing. This is useful for doing DELETE or other
689 more or less obscure HTTP requests. Don't do this at will, make sure your
690 server supports the command first.
691
692 NOTE: many people have wrongly used this option to replace the entire request
693 with their own, including multiple headers and POST contents. While that might
694 work in many cases, it will cause libcurl to send invalid requests and it
695 could possibly confuse the remote server badly. Use \fICURLOPT_POST\fP and
696 \fICURLOPT_POSTFIELDS\fP to set POST data. Use \fICURLOPT_HTTPHEADER\fP to
697 replace or extend the set of headers sent by libcurl. Use
698 \fICURLOPT_HTTP_VERSION\fP to change HTTP version.
699 .IP CURLOPT_FILETIME
700 Pass a long. If it is a non-zero value, libcurl will attempt to get the
701 modification date of the remote document in this operation. This requires that
702 the remote server sends the time or replies to a time querying command. The
703 \fIcurl_easy_getinfo(3)\fP function with the \fICURLINFO_FILETIME\fP argument
704 can be used after a transfer to extract the received time (if any).
705 .IP CURLOPT_NOBODY
706 A non-zero parameter tells the library to not include the body-part in the
707 output. This is only relevant for protocols that have separate header and body
708 parts. On HTTP(S) servers, this will make libcurl do a HEAD request.
709 .IP CURLOPT_INFILESIZE
710 When uploading a file to a remote site, this option should be used to tell
711 libcurl what the expected size of the infile is. This value should be passed
712 as a long. See also \fICURLOPT_INFILESIZE_LARGE\fP.
713 .IP CURLOPT_INFILESIZE_LARGE
714 When uploading a file to a remote site, this option should be used to tell
715 libcurl what the expected size of the infile is.  This value should be passed
716 as a curl_off_t. (Added in 7.11.0)
717 .IP CURLOPT_UPLOAD
718 A non-zero parameter tells the library to prepare for an upload. The
719 \fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE_LARGE\fP are also interesting
720 for uploads.
721 .IP CURLOPT_MAXFILESIZE
722 Pass a long as parameter. This allows you to specify the maximum size (in
723 bytes) of a file to download. If the file requested is larger than this value,
724 the transfer will not start and CURLE_FILESIZE_EXCEEDED will be returned.
725
726 NOTE: The file size is not always known prior to download, and for such files
727 this option has no effect even if the file transfer ends up being larger than
728 this given limit. This concerns both FTP and HTTP transfers.
729 .IP CURLOPT_MAXFILESIZE_LARGE
730 Pass a curl_off_t as parameter. This allows you to specify the maximum size
731 (in bytes) of a file to download. If the file requested is larger than this
732 value, the transfer will not start and \fICURLE_FILESIZE_EXCEEDED\fP will be
733 returned. (Added in 7.11.0)
734
735 NOTE: The file size is not always known prior to download, and for such files
736 this option has no effect even if the file transfer ends up being larger than
737 this given limit. This concerns both FTP and HTTP transfers.
738 .IP CURLOPT_TIMECONDITION
739 Pass a long as parameter. This defines how the \fICURLOPT_TIMEVALUE\fP time
740 value is treated. You can set this parameter to \fICURL_TIMECOND_IFMODSINCE\fP
741 or \fICURL_TIMECOND_IFUNMODSINCE\fP. This feature applies to HTTP and FTP.
742
743 NOTE: The last modification time of a file is not always known and in such
744 instances this feature will have no effect even if the given time condition
745 would have not been met.
746 .IP CURLOPT_TIMEVALUE
747 Pass a long as parameter. This should be the time in seconds since 1 jan 1970,
748 and the time will be used in a condition as specified with 
749 \fICURLOPT_TIMECONDITION\fP.
750 .SH CONNECTION OPTIONS
751 .IP CURLOPT_TIMEOUT
752 Pass a long as parameter containing the maximum time in seconds that you allow
753 the libcurl transfer operation to take. Normally, name lookups can take a
754 considerable time and limiting operations to less than a few minutes risk
755 aborting perfectly normal operations. This option will cause curl to use the
756 SIGALRM to enable time-outing system calls.
757
758 \fBNOTE:\fP this is not recommended to use in unix multi-threaded programs, as
759 it uses signals unless \fICURLOPT_NOSIGNAL\fP (see above) is set.
760 .IP CURLOPT_LOW_SPEED_LIMIT
761 Pass a long as parameter. It contains the transfer speed in bytes per second
762 that the transfer should be below during \fICURLOPT_LOW_SPEED_TIME\fP seconds
763 for the library to consider it too slow and abort.
764 .IP CURLOPT_LOW_SPEED_TIME
765 Pass a long as parameter. It contains the time in seconds that the transfer
766 should be below the \fICURLOPT_LOW_SPEED_LIMIT\fP for the library to consider
767 it too slow and abort.
768 .IP CURLOPT_MAXCONNECTS
769 Pass a long. The set number will be the persistent connection cache size. The
770 set amount will be the maximum amount of simultaneously open connections that
771 libcurl may cache. Default is 5, and there isn't much point in changing this
772 value unless you are perfectly aware of how this work and changes libcurl's
773 behaviour. This concerns connection using any of the protocols that support
774 persistent connections.
775
776 When reaching the maximum limit, curl uses the \fICURLOPT_CLOSEPOLICY\fP to
777 figure out which of the existing connections to close to prevent the number of
778 open connections to increase.
779
780 \fBNOTE:\fP if you already have performed transfers with this curl handle,
781 setting a smaller MAXCONNECTS than before may cause open connections to get
782 closed unnecessarily.
783 .IP CURLOPT_CLOSEPOLICY
784 Pass a long. This option sets what policy libcurl should use when the
785 connection cache is filled and one of the open connections has to be closed to
786 make room for a new connection. This must be one of the CURLCLOSEPOLICY_*
787 defines. Use \fICURLCLOSEPOLICY_LEAST_RECENTLY_USED\fP to make libcurl close
788 the connection that was least recently used, that connection is also least
789 likely to be capable of re-use. Use \fICURLCLOSEPOLICY_OLDEST\fP to make
790 libcurl close the oldest connection, the one that was created first among the
791 ones in the connection cache. The other close policies are not support
792 yet.
793 .IP CURLOPT_FRESH_CONNECT
794 Pass a long. Set to non-zero to make the next transfer use a new (fresh)
795 connection by force. If the connection cache is full before this connection,
796 one of the existing connections will be closed as according to the selected or
797 default policy. This option should be used with caution and only if you
798 understand what it does. Set this to 0 to have libcurl attempt re-using an
799 existing connection (default behavior).
800 .IP CURLOPT_FORBID_REUSE
801 Pass a long. Set to non-zero to make the next transfer explicitly close the
802 connection when done. Normally, libcurl keep all connections alive when done
803 with one transfer in case there comes a succeeding one that can re-use them.
804 This option should be used with caution and only if you understand what it
805 does. Set to 0 to have libcurl keep the connection open for possibly later
806 re-use (default behavior).
807 .IP CURLOPT_CONNECTTIMEOUT
808 Pass a long. It should contain the maximum time in seconds that you allow the
809 connection to the server to take.  This only limits the connection phase, once
810 it has connected, this option is of no more use. Set to zero to disable
811 connection timeout (it will then only timeout on the system's internal
812 timeouts). See also the \fICURLOPT_TIMEOUT\fP option.
813
814 \fBNOTE:\fP this is not recommended to use in unix multi-threaded programs, as
815 it uses signals unless \fICURLOPT_NOSIGNAL\fP (see above) is set.
816 .IP CURLOPT_IPRESOLVE
817 Allows an application to select what kind of IP addresses to use when
818 resolving host names. This is only interesting when using host names that
819 resolve addresses using more than one version of IP. The allowed values are:
820 .RS
821 .IP CURL_IPRESOLVE_WHATEVER
822 Default, resolves addresses to all IP versions that your system allows.
823 .IP CURL_IPRESOLVE_V4
824 Resolve to ipv4 addresses.
825 .IP CURL_IPRESOLVE_V6
826 Resolve to ipv6 addresses.
827 .RE
828 .SH SSL and SECURITY OPTIONS
829 .IP CURLOPT_SSLCERT
830 Pass a pointer to a zero terminated string as parameter. The string should be
831 the file name of your certificate. The default format is "PEM" and can be
832 changed with \fICURLOPT_SSLCERTTYPE\fP.
833 .IP CURLOPT_SSLCERTTYPE
834 Pass a pointer to a zero terminated string as parameter. The string should be
835 the format of your certificate. Supported formats are "PEM" and "DER".  (Added
836 in 7.9.3)
837 .IP CURLOPT_SSLCERTPASSWD
838 Pass a pointer to a zero terminated string as parameter. It will be used as
839 the password required to use the \fICURLOPT_SSLCERT\fP certificate.
840
841 This option is replaced by \fICURLOPT_SSLKEYPASSWD\fP and should only be used
842 for backward compatibility. You never needed a pass phrase to load a
843 certificate but you need one to load your private key.
844 .IP CURLOPT_SSLKEY
845 Pass a pointer to a zero terminated string as parameter. The string should be
846 the file name of your private key. The default format is "PEM" and can be
847 changed with \fICURLOPT_SSLKEYTYPE\fP.
848 .IP CURLOPT_SSLKEYTYPE
849 Pass a pointer to a zero terminated string as parameter. The string should be
850 the format of your private key. Supported formats are "PEM", "DER" and "ENG".
851
852 \fBNOTE:\fPThe format "ENG" enables you to load the private key from a crypto
853 engine. in this case \fICURLOPT_SSLKEY\fP is used as an identifier passed to
854 the engine. You have to set the crypto engine with \fICURLOPT_SSLENGINE\fP.
855 .IP CURLOPT_SSLKEYPASSWD
856 Pass a pointer to a zero terminated string as parameter. It will be used as
857 the password required to use the \fICURLOPT_SSLKEY\fP private key.
858 .IP CURLOPT_SSLENGINE
859 Pass a pointer to a zero terminated string as parameter. It will be used as
860 the identifier for the crypto engine you want to use for your private
861 key.
862
863 \fBNOTE:\fPIf the crypto device cannot be loaded,
864 \fICURLE_SSL_ENGINE_NOTFOUND\fP is returned.
865 .IP CURLOPT_SSLENGINE_DEFAULT
866 Sets the actual crypto engine as the default for (asymetric) crypto
867 operations.
868
869 \fBNOTE:\fPIf the crypto device cannot be set,
870 \fICURLE_SSL_ENGINE_SETFAILED\fP is returned.
871 .IP CURLOPT_SSLVERSION
872 Pass a long as parameter. Set what version of SSL to attempt to use, 2 or
873 3. By default, the SSL library will try to solve this by itself although some
874 servers make this difficult why you at times may have to use this option.
875 .IP CURLOPT_SSL_VERIFYPEER
876 Pass a long that is set to a zero value to stop curl from verifying the peer's
877 certificate (7.10 starting setting this option to non-zero by default).
878 Alternate certificates to verify against can be specified with the
879 \fICURLOPT_CAINFO\fP option or a certificate directory can be specified with
880 the \fICURLOPT_CAPATH\fP option.  As of 7.10, curl installs a default bundle.
881 \fICURLOPT_SSL_VERIFYHOST\fP may also need to be set to 1 or 0 if
882 \fICURLOPT_SSL_VERIFYPEER\fP is disabled (it defaults to 2).
883 .IP CURLOPT_CAINFO
884 Pass a char * to a zero terminated string naming a file holding one or more
885 certificates to verify the peer with. This only makes sense when used in
886 combination with the \fICURLOPT_SSL_VERIFYPEER\fP option.
887 .IP CURLOPT_CAPATH
888 Pass a char * to a zero terminated string naming a directory holding multiple
889 CA certificates to verify the peer with. The certificate directory must be
890 prepared using the openssl c_rehash utility. This only makes sense when used
891 in combination with the \fICURLOPT_SSL_VERIFYPEER\fP option. The
892 \fICURLOPT_CAPATH\fP function apparently does not work in Windows due to some
893 limitation in openssl. (Added in 7.9.8)
894 .IP CURLOPT_RANDOM_FILE
895 Pass a char * to a zero terminated file name. The file will be used to read
896 from to seed the random engine for SSL. The more random the specified file is,
897 the more secure the SSL connection will become.
898 .IP CURLOPT_EGDSOCKET
899 Pass a char * to the zero terminated path name to the Entropy Gathering Daemon
900 socket. It will be used to seed the random engine for SSL.
901 .IP CURLOPT_SSL_VERIFYHOST
902 Pass a long. Set if we should verify the Common name from the peer certificate
903 in the SSL handshake, set 1 to check existence, 2 to ensure that it matches
904 the provided hostname. This is by default set to 2. (default changed in 7.10)
905 .IP CURLOPT_SSL_CIPHER_LIST
906 Pass a char *, pointing to a zero terminated string holding the list of
907 ciphers to use for the SSL connection. The list must be syntactly correct, it
908 consists of one or more cipher strings separated by colons. Commas or spaces
909 are also acceptable separators but colons are normally used, \!, \- and \+ can
910 be used as operators. Valid examples of cipher lists include 'RC4-SHA',
911 \'SHA1+DES\', 'TLSv1' and 'DEFAULT'. The default list is normally set when you
912 compile OpenSSL.
913
914 You'll find more details about cipher lists on this URL:
915 \fIhttp://www.openssl.org/docs/apps/ciphers.html\fP
916 .IP CURLOPT_KRB4LEVEL
917 Pass a char * as parameter. Set the krb4 security level, this also enables
918 krb4 awareness.  This is a string, 'clear', 'safe', 'confidential' or
919 \&'private'.  If the string is set but doesn't match one of these, 'private'
920 will be used. Set the string to NULL to disable kerberos4. The kerberos
921 support only works for FTP.
922 .SH OTHER OPTIONS
923 .IP CURLOPT_PRIVATE
924 Pass a char * as parameter, pointing to data that should be associated with
925 this curl handle.  The pointer can subsequently be retrieved using
926 \fIcurl_easy_getinfo(3)\fP with the CURLINFO_PRIVATE option. libcurl itself
927 does nothing with this data. (Added in 7.10.3)
928 .IP CURLOPT_SHARE
929 Pass a share handle as a parameter. The share handle must have been created by
930 a previous call to \fIcurl_share_init(3)\fP. Setting this option, will make
931 this curl handle use the data from the shared handle instead of keeping the
932 data to itself. This enables several curl handles to share data. If the curl
933 handles are used simultaneously, you \fBMUST\fP use the locking methods in the
934 share handle. See \fIcurl_share_setopt(3)\fP for details.
935 .SH TELNET OPTIONS
936 .IP CURLOPT_TELNETOPTIONS
937 Provide a pointer to a curl_slist with variables to pass to the telnet
938 negotiations. The variables should be in the format <option=value>. libcurl
939 supports the options 'TTYPE', 'XDISPLOC' and 'NEW_ENV'. See the TELNET
940 standard for details.
941 .SH RETURN VALUE
942 CURLE_OK (zero) means that the option was set properly, non-zero means an
943 error occurred as \fI<curl/curl.h>\fP defines. See the \fIlibcurl-errors(3)\fP
944 man page for the full list with descriptions.
945 .SH "SEE ALSO"
946 .BR curl_easy_init "(3), " curl_easy_cleanup "(3), "