From nobody Sun Feb 8 21:28:59 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1636643250; cv=none; d=zohomail.com; s=zohoarc; b=RyVc1VrEL89qaNX46O7RmQRLd0cxFY2PdZBqFNQCaUViYqqyKKPQBSSzX5Be1T2Uj9WUGjA0eI/VyRSqXlzGDi8DHrLj+LhfHn4eI/zr+f9zUjprEq6qZa12pVeCZ60Q20H2vqv01bDKWpFRf8F6Yae+NrAyE/t+FEzcPs48vFI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636643250; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=F+cI+883uZOB6WI8S6uGBVR0zCgmUhrTRL8FuhZZxao=; b=lGoDGSGynQnP0g0IdOxf7OTmcSAE/7jBG/ZjA28AUfe+/JEQPlwIGIeXDAAokhGR4H/850kO/k76sPSz5jKtI1y83Cx9kMeBT8AoT9zRU9IM4/W3OOb+oFsL/JJQ1ws8rAk7+YZguGaOGAg4CYukh+a+Zj1MsK6+P5C/ZtuvsSY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1636643250735209.794083636526; Thu, 11 Nov 2021 07:07:30 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-454-sLZGKNNkPUOt9PnNxcetog-1; Thu, 11 Nov 2021 10:07:26 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1BA148799EC; Thu, 11 Nov 2021 15:07:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EA0F056A88; Thu, 11 Nov 2021 15:07:20 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BA4BB4EA31; Thu, 11 Nov 2021 15:07:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1ABF7IAR004632 for ; Thu, 11 Nov 2021 10:07:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id AED2851E5; Thu, 11 Nov 2021 15:07:18 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A958D51E4 for ; Thu, 11 Nov 2021 15:07:13 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 85AFA800055 for ; Thu, 11 Nov 2021 15:07:13 +0000 (UTC) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-163-mbjFRfAkPDK9MPG1NFVpXg-1; Thu, 11 Nov 2021 10:06:59 -0500 Received: by mail-wm1-f69.google.com with SMTP id o18-20020a05600c511200b00332fa17a02eso2830243wms.5 for ; Thu, 11 Nov 2021 07:06:59 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id z18sm3066563wrq.11.2021.11.11.07.06.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Nov 2021 07:06:56 -0800 (PST) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id C3D781BBF2C5 for ; Thu, 11 Nov 2021 16:06:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636643249; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=F+cI+883uZOB6WI8S6uGBVR0zCgmUhrTRL8FuhZZxao=; b=THHwsKBm9BldlHO7KWPX8Uw9UEh/O/mT7L6R8Zld4LqCJsa93umyfwHcw7GyMSGPDjogpx dbVYH35C4y7z6k05yE7ZUfvLpNgwUl23sQNPmk1wCqEDULEfceUS/6m1KCFCXK2eCkIvxM pHr+fr7lsBZXOJ/SSjvCF6v21S33GIU= X-MC-Unique: sLZGKNNkPUOt9PnNxcetog-1 X-MC-Unique: mbjFRfAkPDK9MPG1NFVpXg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F+cI+883uZOB6WI8S6uGBVR0zCgmUhrTRL8FuhZZxao=; b=AAa89nbvOkejzcc5obkT1yvspvtlLp1lRLzWCsH15Yq7Tq+s+d1ZN9iogiMPELtsd6 Tmjg5sdL3RTZkSpFiZwAChSsb+MkiHZC9/vmieYbz8Na+WrS1L/NYbz/VcWtJMXpJw7F se7LXJTRdN3I1Y4/gxIEdYciDq2u9VTRo87qM3W8nYoXlDt9ufgpWtFOjavpKQ5A/7P5 KXVhmKn6cWL7V92mvcB/x31dXQUK4rPx4OaHuFmr3GsMXxAhkucaZUbwn/j1sBYJtaXE lGgYgFDp5opEM5FfNyNSa/88KKwnAvfzeeO24wMyY98t56jkpLzTX7wuUGcELHpYb4/e 5I+w== X-Gm-Message-State: AOAM5320g6seotpYo/i+4yZiPfgWaP88NCwu17Ek5Q2qgCeDBLz9KdW4 xdTJmP4UKJOD+VTicDSujM74D+TkqtllR994RnlVwB5zJut7btUn91czq437pxSXwM+NBjM4Bz8 TkBEcUZQjAkympxcqdn1JgztldTG5EsgJJhuvqWvTO3RLikEV3z0thvb0+M7yMn4jCaxy974= X-Received: by 2002:a7b:c744:: with SMTP id w4mr9199842wmk.50.1636643218298; Thu, 11 Nov 2021 07:06:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuJyPe0SOhaHf7rELk7EGS24pdo5aMBrwLwNgseHXuaiZ92xoS11UdH23WXE9XaeJfJOKtkg== X-Received: by 2002:a7b:c744:: with SMTP id w4mr9199791wmk.50.1636643217953; Thu, 11 Nov 2021 07:06:57 -0800 (PST) From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH 5/6] Add suggestions for virt-pki-query-dn usage Date: Thu, 11 Nov 2021 16:06:45 +0100 Message-Id: <74f9ad691c3d343ccfb4073ff700147d23834351.1636643087.git.mkletzan@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1636643279607100001 Content-Type: text/plain; charset="utf-8" To make it easier for users to figure out how the DN should be formatted. Signed-off-by: Martin Kletzander --- docs/remote.html.in | 4 ++++ src/remote/libvirtd.conf.in | 5 +++++ src/rpc/virnettlscontext.c | 2 +- tests/virconfdata/libvirtd.conf | 4 ++++ tests/virconfdata/libvirtd.out | 4 ++++ 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/remote.html.in b/docs/remote.html.in index 66f56a3a64fc..efdb2b32535d 100644 --- a/docs/remote.html.in +++ b/docs/remote.html.in @@ -259,6 +259,10 @@ Blank lines and comments beginning with #= are ignored. Note also that GnuTLS returns DNs without spaces after commas between the fields (and this is what we check against), but the openssl x509 tool shows spaces. +

+ To make it easy to see the order of the fields in the DN a helper execut= able + virt-pki-query-dn is provided for this particular use case. +

diff --git a/src/remote/libvirtd.conf.in b/src/remote/libvirtd.conf.in index b18c5885a1a7..2cd20aaa7f52 100644 --- a/src/remote/libvirtd.conf.in +++ b/src/remote/libvirtd.conf.in @@ -292,6 +292,11 @@ # # Any * matches any number of consecutive spaces, like a simplified glob(7= ). # +# The format of the DN for a particular certificate can be queried +# using: +# +# virt-pki-query-dn clientcert.pem +# # NB If this is an empty list, no client can connect, so comment out # entirely rather than using empty list to disable these checks # diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c index 3babf3ee4dc3..1a3dd92676f7 100644 --- a/src/rpc/virnettlscontext.c +++ b/src/rpc/virnettlscontext.c @@ -371,7 +371,7 @@ virNetTLSContextCheckCertDNACL(const char *dname, virReportError(VIR_ERR_SYSTEM_ERROR, "%s", _("Client's Distinguished Name is not on the list " "of allowed clients (tls_allowed_dn_list). Use " - "'certtool -i --infile clientcert.pem' to view the " + "'virt-pki-query-dn clientcert.pem' to view the " "Distinguished Name field in the client certificate, " "or run this daemon with --verbose option.")); return 0; diff --git a/tests/virconfdata/libvirtd.conf b/tests/virconfdata/libvirtd.c= onf index f4c35e9e430f..c5a225e42f6f 100644 --- a/tests/virconfdata/libvirtd.conf +++ b/tests/virconfdata/libvirtd.conf @@ -185,6 +185,10 @@ tls_no_verify_certificate =3D 1 # # Any * matches any number of consecutive spaces, like a simplified glob(7= ). # +# The format of the DN for a particular certificate can be queried +# using: +# +# virt-pki-query-dn clientcert.pem # # NB If this is an empty list, no client can connect, so comment out # entirely rather than using empty list to disable these checks diff --git a/tests/virconfdata/libvirtd.out b/tests/virconfdata/libvirtd.out index a407c5f189e9..754bf56ee4dd 100644 --- a/tests/virconfdata/libvirtd.out +++ b/tests/virconfdata/libvirtd.out @@ -149,6 +149,10 @@ tls_no_verify_certificate =3D 1 # # Any * matches any number of consecutive spaces, like a simplified glob(7= ). # +# The format of the DN for a particular certificate can be queried +# using: +# +# virt-pki-query-dn clientcert.pem # # NB If this is an empty list, no client can connect, so comment out # entirely rather than using empty list to disable these checks --=20 2.33.1