]> git.proxmox.com Git - mirror_qemu.git/commit - block/curl.c
curl: add support for HTTP authentication parameters
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 21 Jan 2016 14:19:20 +0000 (14:19 +0000)
committerJeff Cody <jcody@redhat.com>
Mon, 29 Feb 2016 19:54:31 +0000 (14:54 -0500)
commit1bff96064290b2e9594dcbeea967b3d8cc76e2b2
tree71ba7d2e441011114af1fb96e31fd0f095b1c55d
parent60390a2192e7b38aee18db6ce7fb740498709737
curl: add support for HTTP authentication parameters

If connecting to a web server which has authentication
turned on, QEMU gets a 401 as curl has not been configured
with any authentication credentials.

This adds 4 new parameters to the curl block driver
options 'username', 'password-secret', 'proxy-username'
and 'proxy-password-secret'. Passwords are provided using
the recently added 'secret' object type

 $QEMU \
     -object secret,id=sec0,filename=/home/berrange/example.pw \
     -object secret,id=sec1,filename=/home/berrange/proxy.pw \
     -drive driver=http,url=http://example.com/some.img,\
            username=dan,password-secret=sec0,\
            proxy-username=dan,proxy-password-secret=sec1

Of course it is possible to use the same secret for both the
proxy & server passwords if desired, or omit the proxy auth
details, or the server auth details as required.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-id: 1453385961-10718-3-git-send-email-berrange@redhat.com
Signed-off-by: Jeff Cody <jcody@redhat.com>
block/curl.c