From a2667831d91ca18b9b8d41ad1d52a721103f8750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Tue, 24 Sep 2019 17:51:24 +0800 Subject: Initialisation takes CA certificates file path --- client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'client.c') diff --git a/client.c b/client.c index 179825c..8970b84 100644 --- a/client.c +++ b/client.c @@ -6,7 +6,7 @@ CURL *curl = NULL; char *server_url = NULL; -bool rtclient_init(const char *url) +bool rtclient_init(const char *url, const char *certificate) { curl_global_init(CURL_GLOBAL_SSL); curl = curl_easy_init(); @@ -14,6 +14,8 @@ bool rtclient_init(const char *url) curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); curl_easy_setopt(curl, CURLOPT_REFERER, url); + if (certificate) + curl_easy_setopt(curl, CURLOPT_CAINFO, certificate); #ifdef DEBUG curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); #endif -- cgit v1.2.3