CURLINFO_CAINFO.md (1517B)
1 --- 2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 SPDX-License-Identifier: curl 4 Title: CURLINFO_CAINFO 5 Section: 3 6 Source: libcurl 7 See-also: 8 - CURLINFO_CAPATH (3) 9 - curl_easy_getinfo (3) 10 - curl_easy_setopt (3) 11 Protocol: 12 - TLS 13 TLS-backend: 14 - All 15 Added-in: 7.84.0 16 --- 17 18 # NAME 19 20 CURLINFO_CAINFO - get the default built-in CA certificate path 21 22 # SYNOPSIS 23 24 ~~~c 25 #include <curl/curl.h> 26 27 CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CAINFO, char **path); 28 ~~~ 29 30 # DESCRIPTION 31 32 Pass a pointer to a char pointer to receive the pointer to a null-terminated 33 string holding the default built-in path used for the CURLOPT_CAINFO(3) 34 option unless set by the user. 35 36 Note that in a situation where libcurl has been built to support multiple TLS 37 libraries, this option might return a string even if the specific TLS library 38 currently set to be used does not support CURLOPT_CAINFO(3). 39 40 This is a path identifying a single file containing CA certificates. 41 42 The **path** pointer is set to NULL if there is no default path. 43 44 # %PROTOCOLS% 45 46 # EXAMPLE 47 48 ~~~c 49 int main(void) 50 { 51 CURL *curl = curl_easy_init(); 52 if(curl) { 53 char *cainfo = NULL; 54 curl_easy_getinfo(curl, CURLINFO_CAINFO, &cainfo); 55 if(cainfo) { 56 printf("default ca info path: %s\n", cainfo); 57 } 58 curl_easy_cleanup(curl); 59 } 60 } 61 ~~~ 62 63 # %AVAILABILITY% 64 65 # RETURN VALUE 66 67 curl_easy_getinfo(3) returns a CURLcode indicating success or error. 68 69 CURLE_OK (0) means everything was OK, non-zero means an error occurred, see 70 libcurl-errors(3).