1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_SSL_SESSIONID_CACHE
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_DNS_CACHE_TIMEOUT (3)
9  - CURLOPT_MAXAGE_CONN (3)
10  - CURLOPT_MAXLIFETIME_CONN (3)
11  - CURLOPT_SSLVERSION (3)
12Protocol:
13  - TLS
14TLS-backend:
15  - All
16---
17
18# NAME
19
20CURLOPT_SSL_SESSIONID_CACHE - use the SSL session-ID cache
21
22# SYNOPSIS
23
24~~~c
25#include <curl/curl.h>
26
27CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_SESSIONID_CACHE,
28                         long enabled);
29~~~
30
31# DESCRIPTION
32
33Pass a long set to 0 to disable libcurl's use of SSL session-ID caching. Set
34this to 1 to enable it. By default all transfers are done using the cache
35enabled. While nothing ever should get hurt by attempting to reuse SSL
36session-IDs, there seem to be or have been broken SSL implementations in the
37wild that may require you to disable this in order for you to succeed.
38
39# DEFAULT
40
411
42
43# EXAMPLE
44
45~~~c
46int main(void)
47{
48  CURL *curl = curl_easy_init();
49  if(curl) {
50    CURLcode res;
51    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
52    /* switch off session-id use! */
53    curl_easy_setopt(curl, CURLOPT_SSL_SESSIONID_CACHE, 0L);
54    res = curl_easy_perform(curl);
55    curl_easy_cleanup(curl);
56  }
57}
58~~~
59
60# AVAILABILITY
61
62Added in 7.16.0
63
64# RETURN VALUE
65
66Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
67