1*6236dae4SAndroid Build Coastguard Worker--- 2*6236dae4SAndroid Build Coastguard Workerc: Copyright (C) Daniel Stenberg, <[email protected]>, et al. 3*6236dae4SAndroid Build Coastguard WorkerSPDX-License-Identifier: curl 4*6236dae4SAndroid Build Coastguard WorkerTitle: CURLINFO_CAINFO 5*6236dae4SAndroid Build Coastguard WorkerSection: 3 6*6236dae4SAndroid Build Coastguard WorkerSource: libcurl 7*6236dae4SAndroid Build Coastguard WorkerSee-also: 8*6236dae4SAndroid Build Coastguard Worker - CURLINFO_CAPATH (3) 9*6236dae4SAndroid Build Coastguard Worker - curl_easy_getinfo (3) 10*6236dae4SAndroid Build Coastguard Worker - curl_easy_setopt (3) 11*6236dae4SAndroid Build Coastguard WorkerProtocol: 12*6236dae4SAndroid Build Coastguard Worker - TLS 13*6236dae4SAndroid Build Coastguard WorkerTLS-backend: 14*6236dae4SAndroid Build Coastguard Worker - All 15*6236dae4SAndroid Build Coastguard WorkerAdded-in: 7.84.0 16*6236dae4SAndroid Build Coastguard Worker--- 17*6236dae4SAndroid Build Coastguard Worker 18*6236dae4SAndroid Build Coastguard Worker# NAME 19*6236dae4SAndroid Build Coastguard Worker 20*6236dae4SAndroid Build Coastguard WorkerCURLINFO_CAINFO - get the default built-in CA certificate path 21*6236dae4SAndroid Build Coastguard Worker 22*6236dae4SAndroid Build Coastguard Worker# SYNOPSIS 23*6236dae4SAndroid Build Coastguard Worker 24*6236dae4SAndroid Build Coastguard Worker~~~c 25*6236dae4SAndroid Build Coastguard Worker#include <curl/curl.h> 26*6236dae4SAndroid Build Coastguard Worker 27*6236dae4SAndroid Build Coastguard WorkerCURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CAINFO, char **path); 28*6236dae4SAndroid Build Coastguard Worker~~~ 29*6236dae4SAndroid Build Coastguard Worker 30*6236dae4SAndroid Build Coastguard Worker# DESCRIPTION 31*6236dae4SAndroid Build Coastguard Worker 32*6236dae4SAndroid Build Coastguard WorkerPass a pointer to a char pointer to receive the pointer to a null-terminated 33*6236dae4SAndroid Build Coastguard Workerstring holding the default built-in path used for the CURLOPT_CAINFO(3) 34*6236dae4SAndroid Build Coastguard Workeroption unless set by the user. 35*6236dae4SAndroid Build Coastguard Worker 36*6236dae4SAndroid Build Coastguard WorkerNote that in a situation where libcurl has been built to support multiple TLS 37*6236dae4SAndroid Build Coastguard Workerlibraries, this option might return a string even if the specific TLS library 38*6236dae4SAndroid Build Coastguard Workercurrently set to be used does not support CURLOPT_CAINFO(3). 39*6236dae4SAndroid Build Coastguard Worker 40*6236dae4SAndroid Build Coastguard WorkerThis is a path identifying a single file containing CA certificates. 41*6236dae4SAndroid Build Coastguard Worker 42*6236dae4SAndroid Build Coastguard WorkerThe **path** pointer is set to NULL if there is no default path. 43*6236dae4SAndroid Build Coastguard Worker 44*6236dae4SAndroid Build Coastguard Worker# %PROTOCOLS% 45*6236dae4SAndroid Build Coastguard Worker 46*6236dae4SAndroid Build Coastguard Worker# EXAMPLE 47*6236dae4SAndroid Build Coastguard Worker 48*6236dae4SAndroid Build Coastguard Worker~~~c 49*6236dae4SAndroid Build Coastguard Workerint main(void) 50*6236dae4SAndroid Build Coastguard Worker{ 51*6236dae4SAndroid Build Coastguard Worker CURL *curl = curl_easy_init(); 52*6236dae4SAndroid Build Coastguard Worker if(curl) { 53*6236dae4SAndroid Build Coastguard Worker char *cainfo = NULL; 54*6236dae4SAndroid Build Coastguard Worker curl_easy_getinfo(curl, CURLINFO_CAINFO, &cainfo); 55*6236dae4SAndroid Build Coastguard Worker if(cainfo) { 56*6236dae4SAndroid Build Coastguard Worker printf("default ca info path: %s\n", cainfo); 57*6236dae4SAndroid Build Coastguard Worker } 58*6236dae4SAndroid Build Coastguard Worker curl_easy_cleanup(curl); 59*6236dae4SAndroid Build Coastguard Worker } 60*6236dae4SAndroid Build Coastguard Worker} 61*6236dae4SAndroid Build Coastguard Worker~~~ 62*6236dae4SAndroid Build Coastguard Worker 63*6236dae4SAndroid Build Coastguard Worker# %AVAILABILITY% 64*6236dae4SAndroid Build Coastguard Worker 65*6236dae4SAndroid Build Coastguard Worker# RETURN VALUE 66*6236dae4SAndroid Build Coastguard Worker 67*6236dae4SAndroid Build Coastguard WorkerReturns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. 68