RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1598167 - VNC server TLS config must change to use new tls-creds-x509 object syntax
Summary: VNC server TLS config must change to use new tls-creds-x509 object syntax
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: libvirt
Version: 8.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Ján Tomko
QA Contact: yafu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-04 14:03 UTC by Daniel Berrangé
Modified: 2019-06-14 01:18 UTC (History)
5 users (show)

Fixed In Version: libvirt-4.5.0-9.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-14 01:18:42 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
vnc-tls.sh (1.52 KB, application/x-shellscript)
2019-01-10 06:11 UTC, yafu
no flags Details

Description Daniel Berrangé 2018-07-04 14:03:34 UTC
Description of problem:
When TLS support was added to QEMU chardevs, migration, NBD, the existing syntax used by VNC was deprecated. Unfortunately it appears that libvirt is still using the deprecated syntax, as the VNC server code not switched to the new syntax when TLS was added to chardevs/migration/NBD.

QEMU will shortly be deleting support for the deprecated syntax entirely, so libvirt must switch to the new syntax for VNC ASAP to avoid regression.

ie it must  use   -object tls-creds-x509,.... and  -vnc tls-creds=$ID instead of the 'tls', 'x509' or 'x509verify' flags to -vnc.

This will also allow for using encrypted TLS creds with VNC.

Version-Release number of selected component (if applicable):
4.5.0-1.el8

Comment 1 Ján Tomko 2018-07-17 15:17:26 UTC
Upstream patches switching to the new syntax:
https://www.redhat.com/archives/libvir-list/2018-July/msg01085.html

They do not include the ability to use encrypted TLS creds.

Comment 2 Daniel Berrangé 2018-07-18 10:37:54 UTC
Filed a separate bug to track use of encrypted creds

https://bugzilla.redhat.com/show_bug.cgi?id=1602418

Comment 3 Ján Tomko 2018-07-18 15:41:40 UTC
Pushed upstream as:
Author:     Ján Tomko <jtomko>
CommitDate: 2018-07-18 17:29:51 +0200

    qemu: vnc: switch to tls-creds-x509
    
    The tls, x509 and x509verify options were deprecated in QEMU v2.5.0:
    
    commit 3e305e4a4752f70c0b5c3cf5b43ec957881714f7
    Author:     Daniel P. Berrange <berrange>
    
        ui: convert VNC server to use QCryptoTLSSession
    
    Use the tls-creds-x509 object when available.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1598167
    
    Signed-off-by: Ján Tomko <jtomko>

git describe: v4.5.0-166-g17f50c8260

Comment 6 yafu 2019-01-10 06:11:01 UTC
Verified with:
libvirt-4.5.0-16.el8.x86_64
qemu-kvm-2.12.0-51.module+el8+2608+a17c4bfe.x86_64

Test steps:
1.Setup tls env using scripts in attachment:
#sh vnc-tls.sh

2.Enable vnc_tls in qemu.conf:
vnc_tls = 1 
vnc_tls_x509_cert_dir = "/etc/pki/libvirt-vnc"

3.Restart libvirtd:
#systemctl restart libvirtd

4.Define a guest with vnc graphics device:
#virsh edit vm1
 <graphics type='vnc' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
 </graphics>

5.Start the guest:
#virsh start vm

6.Check the qemu cmd line:
# ps aux  | grep -i vnc
..-object tls-creds-x509,id=vnc-tls-creds0,dir=/etc/pki/libvirt-vnc,endpoint=server,verify-peer=no -vnc 0.0.0.0:1,tls-creds=vnc-tls-creds0
..

7.Can connect guest by vncviewer successfully:
#vncviewer -X509CA /etc/pki/libvirt-vnc/ca-cert.pem
Click on 'yes' in popped vncviewer window to continue.

Comment 7 yafu 2019-01-10 06:11:49 UTC
Created attachment 1519657 [details]
vnc-tls.sh


Note You need to log in before you can comment on or make changes to this bug.