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
16Added-in: 7.16.0
17---
18
19# NAME
20
21CURLOPT_SSL_SESSIONID_CACHE - use the SSL session-ID cache
22
23# SYNOPSIS
24
25~~~c
26#include <curl/curl.h>
27
28CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_SESSIONID_CACHE,
29                         long enabled);
30~~~
31
32# DESCRIPTION
33
34Pass a long set to 0 to disable libcurl's use of SSL session-ID caching. Set
35this to 1 to enable it. By default all transfers are done using the cache
36enabled. While nothing ever should get hurt by attempting to reuse SSL
37session-IDs, there seem to be or have been broken SSL implementations in the
38wild that may require you to disable this in order for you to succeed.
39
40# DEFAULT
41
421
43
44# %PROTOCOLS%
45
46# EXAMPLE
47
48~~~c
49int main(void)
50{
51  CURL *curl = curl_easy_init();
52  if(curl) {
53    CURLcode res;
54    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
55    /* switch off session-id use */
56    curl_easy_setopt(curl, CURLOPT_SSL_SESSIONID_CACHE, 0L);
57    res = curl_easy_perform(curl);
58    curl_easy_cleanup(curl);
59  }
60}
61~~~
62
63# %AVAILABILITY%
64
65# RETURN VALUE
66
67Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
68