libvirt/SOURCES/libvirt-qemu-block-Implement-ssl-verification-configuration.patch
2021-09-10 11:57:33 +00:00

66 lines
3.0 KiB
Diff

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