|
|
4b6aa8 |
From 5cbc284813a85df42d8031612030f1f27d8ea075 Mon Sep 17 00:00:00 2001
|
|
|
4b6aa8 |
From: Matej Habrnal <mhabrnal@redhat.com>
|
|
|
4b6aa8 |
Date: Thu, 3 Sep 2015 13:54:38 +0200
|
|
|
4b6aa8 |
Subject: [PATCH] curl: add posibility to use own Certificate Authority cert
|
|
|
4b6aa8 |
|
|
|
4b6aa8 |
Related to rhbz#1223805
|
|
|
4b6aa8 |
|
|
|
4b6aa8 |
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
|
|
|
4b6aa8 |
---
|
|
|
4b6aa8 |
src/include/libreport_curl.h | 1 +
|
|
|
4b6aa8 |
src/lib/curl.c | 2 ++
|
|
|
4b6aa8 |
2 files changed, 3 insertions(+)
|
|
|
4b6aa8 |
|
|
|
4b6aa8 |
diff --git a/src/include/libreport_curl.h b/src/include/libreport_curl.h
|
|
|
4b6aa8 |
index 4b41ecc..812738c 100644
|
|
|
4b6aa8 |
--- a/src/include/libreport_curl.h
|
|
|
4b6aa8 |
+++ b/src/include/libreport_curl.h
|
|
|
4b6aa8 |
@@ -37,6 +37,7 @@ typedef struct post_state {
|
|
|
4b6aa8 |
const char *password;
|
|
|
4b6aa8 |
const char *client_cert_path;
|
|
|
4b6aa8 |
const char *client_key_path;
|
|
|
4b6aa8 |
+ const char *cert_authority_cert_path;
|
|
|
4b6aa8 |
/* Results of POST transaction: */
|
|
|
4b6aa8 |
int http_resp_code;
|
|
|
4b6aa8 |
/* cast from CURLcode enum.
|
|
|
4b6aa8 |
diff --git a/src/lib/curl.c b/src/lib/curl.c
|
|
|
4b6aa8 |
index f7321b5..606d9ea 100644
|
|
|
4b6aa8 |
--- a/src/lib/curl.c
|
|
|
4b6aa8 |
+++ b/src/lib/curl.c
|
|
|
4b6aa8 |
@@ -542,6 +542,8 @@ post(post_state_t *state,
|
|
|
4b6aa8 |
xcurl_easy_setopt_ptr(handle, CURLOPT_SSLCERT, state->client_cert_path);
|
|
|
4b6aa8 |
xcurl_easy_setopt_ptr(handle, CURLOPT_SSLKEY, state->client_key_path);
|
|
|
4b6aa8 |
}
|
|
|
4b6aa8 |
+ if (state->cert_authority_cert_path)
|
|
|
4b6aa8 |
+ xcurl_easy_setopt_ptr(handle, CURLOPT_CAINFO, state->cert_authority_cert_path);
|
|
|
4b6aa8 |
|
|
|
4b6aa8 |
// This is the place where everything happens.
|
|
|
4b6aa8 |
// Here errors are not limited to "out of memory", can't just die.
|
|
|
4b6aa8 |
--
|
|
|
4b6aa8 |
2.4.3
|
|
|
4b6aa8 |
|