summaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-24 23:07:24 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-24 23:07:24 +0800
commit57bb4f20c1cf737b49eac2a8be108a9ffbde60ce (patch)
tree01a1857239886f61b433f72ae0ad826a74292654 /client.c
parent396df5cd796f7eed89ff5a5acf6f7c714b2cf0a7 (diff)
Initialisation takes CA certificates file path
Diffstat (limited to 'client.c')
-rw-r--r--client.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/client.c b/client.c
index 2d315ab..608b7e5 100644
--- a/client.c
+++ b/client.c
@@ -6,13 +6,15 @@
CURL *curl = NULL;
char *server_url = NULL;
-bool icclient_init(const char *url)
+bool icclient_init(const char *url, const char *certificate)
{
curl_global_init(CURL_GLOBAL_SSL);
curl = curl_easy_init();
if (curl) {
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "");
+ if (certificate)
+ curl_easy_setopt(curl, CURLOPT_CAINFO, certificate);
#ifdef DEBUG
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
#endif