summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client.c4
-rw-r--r--main.c2
-rw-r--r--rtclient/client.h2
3 files changed, 5 insertions, 3 deletions
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
diff --git a/main.c b/main.c
index c3fb13e..e0129e4 100644
--- a/main.c
+++ b/main.c
@@ -25,7 +25,7 @@ int main(void)
strncpy(pass, pass_line, pass_nread);
free(pass_line);
- rtclient_init(url);
+ rtclient_init(url, NULL);
free(url);
rtclient_login(name, pass);
diff --git a/rtclient/client.h b/rtclient/client.h
index 4f74536..db9918e 100644
--- a/rtclient/client.h
+++ b/rtclient/client.h
@@ -5,7 +5,7 @@
extern "C" {
#endif
- bool rtclient_init(const char *url);
+ bool rtclient_init(const char *url, const char *certificate);
void rtclient_login(const char *name, const char *password);
void rtclient_cleanup();