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