1--- 2c: Copyright (C) Daniel Stenberg, <daniel.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) 12--- 13 14# NAME 15 16CURLOPT_SSL_SESSIONID_CACHE - use the SSL session-ID cache 17 18# SYNOPSIS 19 20~~~c 21#include <curl/curl.h> 22 23CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_SESSIONID_CACHE, 24 long enabled); 25~~~ 26 27# DESCRIPTION 28 29Pass a long set to 0 to disable libcurl's use of SSL session-ID caching. Set 30this to 1 to enable it. By default all transfers are done using the cache 31enabled. While nothing ever should get hurt by attempting to reuse SSL 32session-IDs, there seem to be or have been broken SSL implementations in the 33wild that may require you to disable this in order for you to succeed. 34 35# DEFAULT 36 371 38 39# PROTOCOLS 40 41All TLS-based 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