From: Kevin Wolf <kwolf@redhat.com>
To: Matthew Booth <mbooth@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/4] curl: Add sslverify option
Date: Thu, 15 May 2014 13:33:20 +0200 [thread overview]
Message-ID: <20140515113320.GC3822@noname.redhat.com> (raw)
In-Reply-To: <1400110123-2692-3-git-send-email-mbooth@redhat.com>
Am 15.05.2014 um 01:28 hat Matthew Booth geschrieben:
> This allows qemu to use images over https with a self-signed certificate. It
> defaults to verifying the certificate.
>
> Signed-off-by: Matthew Booth <mbooth@redhat.com>
> ---
> block/curl.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/block/curl.c b/block/curl.c
> index 1b9f2f2..43d6646 100644
> --- a/block/curl.c
> +++ b/block/curl.c
> @@ -23,6 +23,7 @@
> */
> #include "qemu-common.h"
> #include "block/block_int.h"
> +#include "qapi/qmp/qbool.h"
> #include <curl/curl.h>
>
> // #define DEBUG
> @@ -69,6 +70,7 @@ static CURLMcode __curl_multi_socket_action(CURLM *multi_handle,
>
> #define CURL_BLOCK_OPT_URL "url"
> #define CURL_BLOCK_OPT_READAHEAD "readahead"
> +#define CURL_BLOCK_OPT_SSLVERIFY "sslverify"
>
> struct BDRVCURLState;
>
> @@ -106,6 +108,7 @@ typedef struct BDRVCURLState {
> CURLState states[CURL_NUM_STATES];
> char *url;
> size_t readahead_size;
> + bool sslverify;
> bool accept_range;
> } BDRVCURLState;
>
> @@ -372,6 +375,7 @@ static CURLState *curl_init_state(BDRVCURLState *s)
> return NULL;
> }
> curl_easy_setopt(state->curl, CURLOPT_URL, s->url);
> + curl_easy_setopt(state->curl, CURLOPT_SSL_VERIFYPEER, s->sslverify);
block/curl.c: In function 'curl_init_state':
block/curl.c:378:1043: error: call to '_curl_easy_setopt_err_long' declared with attribute warning: curl_easy_setopt expects a long argument for this option [-Werror]
curl_easy_setopt(state->curl, CURLOPT_SSL_VERIFYPEER, s->sslverify);
Squashing in this hunk:
--- a/block/curl.c
+++ b/block/curl.c
@@ -375,7 +375,8 @@ static CURLState *curl_init_state(BDRVCURLState *s)
return NULL;
}
curl_easy_setopt(state->curl, CURLOPT_URL, s->url);
- curl_easy_setopt(state->curl, CURLOPT_SSL_VERIFYPEER, s->sslverify);
+ curl_easy_setopt(state->curl, CURLOPT_SSL_VERIFYPEER,
+ (long) s->sslverify);
curl_easy_setopt(state->curl, CURLOPT_TIMEOUT, 5);
curl_easy_setopt(state->curl, CURLOPT_WRITEFUNCTION,
(void *)curl_read_cb);
Kevin
next prev parent reply other threads:[~2014-05-15 11:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-14 23:28 [Qemu-devel] [PATCH 1/4] curl: Fix build when curl_multi_socket_action isn't available Matthew Booth
2014-05-14 23:28 ` [Qemu-devel] [PATCH 2/4] curl: Remove broken parsing of options from url Matthew Booth
2014-05-14 23:28 ` [Qemu-devel] [PATCH 3/4] curl: Add sslverify option Matthew Booth
2014-05-15 11:33 ` Kevin Wolf [this message]
2014-05-14 23:28 ` [Qemu-devel] [PATCH 4/4] curl: Add usage documentation Matthew Booth
2014-05-15 11:35 ` [Qemu-devel] [PATCH 1/4] curl: Fix build when curl_multi_socket_action isn't available Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140515113320.GC3822@noname.redhat.com \
--to=kwolf@redhat.com \
--cc=mbooth@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).