render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
fbe740
From 35ea15a7ddb570301c6dceb01e13e6f8ef6ba478 Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <35ea15a7ddb570301c6dceb01e13e6f8ef6ba478@dist-git>
fbe740
From: Peter Krempa <pkrempa@redhat.com>
fbe740
Date: Mon, 16 Mar 2020 22:12:01 +0100
fbe740
Subject: [PATCH] qemu: block: Implement ssl verification configuration
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
Allow disabling of SSL certificate validation for HTTPS and FTPS drives
fbe740
in qemu.
fbe740
fbe740
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
(cherry picked from commit 304da9376c972413d77cc6c7f094a1b39d651ea8)
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1804750
fbe740
Message-Id: <a36c004cf393076f7d6cbfa377909c91b99e768d.1584391727.git.pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
---
fbe740
 src/qemu/qemu_block.c                                       | 1 +
fbe740
 tests/qemuxml2argvdata/disk-network-http.x86_64-latest.args | 3 ++-
fbe740
 tests/qemuxml2argvdata/disk-network-http.xml                | 1 +
fbe740
 3 files changed, 4 insertions(+), 1 deletion(-)
fbe740
fbe740
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
fbe740
index 5144cf266f..e60975a142 100644
fbe740
--- a/src/qemu/qemu_block.c
fbe740
+++ b/src/qemu/qemu_block.c
fbe740
@@ -713,6 +713,7 @@ qemuBlockStorageSourceGetCURLProps(virStorageSourcePtr src,
fbe740
                                           "s:url", uristr,
fbe740
                                           "S:username", username,
fbe740
                                           "S:password-secret", passwordalias,
fbe740
+                                          "T:sslverify", src->sslverify,
fbe740
                                           NULL));
fbe740
 
fbe740
     return ret;
fbe740
diff --git a/tests/qemuxml2argvdata/disk-network-http.x86_64-latest.args b/tests/qemuxml2argvdata/disk-network-http.x86_64-latest.args
fbe740
index d39f357072..86e4597a81 100644
fbe740
--- a/tests/qemuxml2argvdata/disk-network-http.x86_64-latest.args
fbe740
+++ b/tests/qemuxml2argvdata/disk-network-http.x86_64-latest.args
fbe740
@@ -46,7 +46,8 @@ id=virtio-disk1 \
fbe740
 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=libvirt-2-format,\
fbe740
 id=virtio-disk2 \
fbe740
 -blockdev '{"driver":"https","url":"https://example.org:1234/test4.img",\
fbe740
-"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
fbe740
+"sslverify":false,"node-name":"libvirt-1-storage","auto-read-only":true,\
fbe740
+"discard":"unmap"}' \
fbe740
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw",\
fbe740
 "file":"libvirt-1-storage"}' \
fbe740
 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=libvirt-1-format,\
fbe740
diff --git a/tests/qemuxml2argvdata/disk-network-http.xml b/tests/qemuxml2argvdata/disk-network-http.xml
fbe740
index 83a9865c83..8c475aec1d 100644
fbe740
--- a/tests/qemuxml2argvdata/disk-network-http.xml
fbe740
+++ b/tests/qemuxml2argvdata/disk-network-http.xml
fbe740
@@ -38,6 +38,7 @@
fbe740
       <driver name='qemu' type='raw'/>
fbe740
       <source protocol='https' name='test4.img'>
fbe740
         <host name='example.org' port='1234'/>
fbe740
+        <ssl verify='no'/>
fbe740
       </source>
fbe740
       <target dev='vdd' bus='virtio'/>
fbe740
     </disk>
fbe740
-- 
fbe740
2.25.1
fbe740