curl_easy_setopt.3 90 KB

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