summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-10-21 22:32:17 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-10-23 00:27:55 -0400
commit8847551bcbfa8265bae04f567bb1aadc7b480325 (patch)
tree0a0b95a05281651fcf5da28d40564aa46ccbb1ca /src
parent30776485c5bc2d9c356e875f2aee874d22c393b7 (diff)
journal-upload: fix --trust=all option
Diffstat (limited to 'src')
-rw-r--r--src/journal-remote/journal-upload.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c
index 229bceeb80..fc095c3635 100644
--- a/src/journal-remote/journal-upload.c
+++ b/src/journal-remote/journal-upload.c
@@ -63,7 +63,7 @@ static const char *arg_save_state = NULL;
#define STATE_FILE "/var/lib/systemd/journal-upload/state"
#define easy_setopt(curl, opt, value, level, cmd) \
- { \
+ do { \
code = curl_easy_setopt(curl, opt, value); \
if (code) { \
log_full(level, \
@@ -71,7 +71,7 @@ static const char *arg_save_state = NULL;
curl_easy_strerror(code)); \
cmd; \
} \
- }
+ } while(0)
static size_t output_callback(char *buf,
size_t size,
@@ -254,7 +254,10 @@ int start_upload(Uploader *u,
LOG_ERR, return -EXFULL);
}
- if (arg_trust || startswith(u->url, "https://"))
+ if (streq_ptr(arg_trust, "all"))
+ easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0,
+ LOG_ERR, return -EUCLEAN);
+ else if (arg_trust || startswith(u->url, "https://"))
easy_setopt(curl, CURLOPT_CAINFO, arg_trust ?: TRUST_FILE,
LOG_ERR, return -EXFULL);