From nobody Mon Feb 9 00:30:24 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=1636663052; cv=none;
d=zohomail.com; s=zohoarc;
b=kVXaLR4lz7rjI2VIwaE3dgVtAKcdUMJ7dcn3WwJLe9iIh0ZH/MqMcg2U+MAgx5bs4wApdUyNwaybipRyYr6WEa35vUW+BlYYZX4S55EW01DCWpn7BXMXlOHbTjR3P83wmbiWUD5bE7016kxDA0CIB2mKLMHQZDhBpqjomwhOxgQ=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
s=zohoarc;
t=1636663052;
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=HpFljb0P5iYY0zqGQmtGa3EdKKNcVfMWFbAVhFr2DRo=;
b=OYtujUaoWgvNidoIRVQUhWq8bZAQBvtrLYemNS2XcTc38eV4jChv/1C46hceQ/Kfe8KZeYC81TxTPgPTUdXSgE7yMMPmPTZgxLFKpFT63xMKUzsoM/oDUheqvIe9Qnc69fy5npHhz+0etuTf5E+qeLWQ2VwsxVsooGQbXVjHSSU=
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 163666305260253.405965907888685;
Thu, 11 Nov 2021 12:37:32 -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-98-NnN1GeOWN2iMbXzvRoxH3g-1; Thu, 11 Nov 2021 15:37:27 -0500
Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com
[10.5.11.11])
(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
(No client certificate requested)
by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 46F641030C25;
Thu, 11 Nov 2021 20:37:23 +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 29A6667849;
Thu, 11 Nov 2021 20:37:23 +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 9772E4E58F;
Thu, 11 Nov 2021 20:37:22 +0000 (UTC)
Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com
[10.11.54.4])
by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
id 1ABKb8I9007086 for ;
Thu, 11 Nov 2021 15:37:08 -0500
Received: by smtp.corp.redhat.com (Postfix)
id 825D82026D6B; Thu, 11 Nov 2021 20:37:08 +0000 (UTC)
Received: from mimecast-mx02.redhat.com
(mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17])
by smtp.corp.redhat.com (Postfix) with ESMTPS id 7BEE42026D48
for ; Thu, 11 Nov 2021 20:37:02 +0000 (UTC)
Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com
[205.139.110.61])
(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 C01A185A5B5
for ; Thu, 11 Nov 2021 20:37:02 +0000 (UTC)
Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com
[209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id
us-mta-560-cUanGiRNPCOrPt8MvzAdzQ-1; Thu, 11 Nov 2021 15:37:01 -0500
Received: by mail-ed1-f72.google.com with SMTP id
w13-20020a05640234cd00b003e2fde5ff8aso6354442edc.14
for ; Thu, 11 Nov 2021 12:37:01 -0800 (PST)
Received: from wheatley.localdomain (k8r.cz. [95.82.177.71])
by smtp.gmail.com with ESMTPSA id
e13sm1830474eje.95.2021.11.11.12.36.58
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 11 Nov 2021 12:36:58 -0800 (PST)
Received: from wheatley.k8r.cz (wheatley.k8r.cz [127.0.0.1])
by wheatley.localdomain (Postfix) with ESMTP id 576731BCD6D3;
Thu, 11 Nov 2021 21:36:58 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
s=mimecast20190719; t=1636663051;
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=HpFljb0P5iYY0zqGQmtGa3EdKKNcVfMWFbAVhFr2DRo=;
b=ViZBZQz99p8ilweClJTsdKkASjQbOi81ovuRHjxacu5I/vTCWI9zYJk9m+Ykx8xq2GGK+m
QqlkLLiFbe9zbV1C2FqBvUhuhaimoLxpGn8QKvIf1IkRoSThikC7K6FMbk7jKkV3MuBRTg
W2iu2T98Cn2pwkIoJqFOM7iXknHZ64U=
X-MC-Unique: NnN1GeOWN2iMbXzvRoxH3g-1
X-MC-Unique: cUanGiRNPCOrPt8MvzAdzQ-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:cc:subject:date:message-id:in-reply-to
:references:mime-version:content-transfer-encoding;
bh=HpFljb0P5iYY0zqGQmtGa3EdKKNcVfMWFbAVhFr2DRo=;
b=hY6cRVzyLVF80eRZ2U9Rka8zu5LtM/X5A8AX6G/C2586Xzli2MFVjCQEJ/jYPnnW5k
PfiR6ZNzeZRA3/O1FCMrrgbviywv5biarYTFQUovAsIVespkrLEw6EAOk8+Nw/xi1foB
U1BAgMHj/WZBD+QbcpwoL870+6um4YV7+JhYOMmkPywGIlborV5T9Yj2IaZGXpUAUK3n
Gw1QT78MkkO1jVXfznOii4TZMpnx765BoQmLZWGRFtU+W6o3cZGFjxGlyskDPkyTDusV
S5eoONeFurQUq0qS2KZJDM1Btpbu1pFeW+CS4KfBw+DTQtXwIt09/+dW6fHjqKFTUG+p
kIng==
X-Gm-Message-State: AOAM532vMNGonKVqDp3/FnKf7C9bjcXh4VhwFx7u0ucmXL9I5W9Rmd8O
IzaN/odnI0fPOrXSFZf/bXwvjxBklOsjgXNm++KdEcmUFyBEKkagCw4KIqUKz3Hk7bNz0j0QIO8
wvAO58w1XKtbluixHPiI=
X-Received: by 2002:a05:6402:147:: with SMTP id
s7mr2287813edu.8.1636663020446;
Thu, 11 Nov 2021 12:37:00 -0800 (PST)
X-Google-Smtp-Source:
ABdhPJx9aNVfO4T5aUWZrlzfgqSzg9TfukeiawK5pvLP8i/U4JjbA4q54ASKPaboEiypjXZEaqKPXw==
X-Received: by 2002:a05:6402:147:: with SMTP id
s7mr2287781edu.8.1636663020268;
Thu, 11 Nov 2021 12:37:00 -0800 (PST)
From: Martin Kletzander
To: libvir-list@redhat.com
Subject: [PATCH v2 2/3] Add suggestions for virt-pki-query-dn usage
Date: Thu, 11 Nov 2021 21:36:56 +0100
Message-Id:
<6da09569caf0e0a22a5ef8e81e75e0a10e612c33.1636662545.git.mkletzan@redhat.com>
In-Reply-To:
References:
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4
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.11
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-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-ZohoMail-DKIM: pass (identity @redhat.com)
X-ZM-MESSAGEID: 1636663053460100001
To make it easier for users to figure out how the DN should be formatted.
Signed-off-by: Martin Kletzander
Reviewed-by: Daniel P. Berrang=C3=A9
---
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