From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 8AEA71FF0E1 for ; Mon, 16 Nov 2026 02:00:43 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 920F3216F0; Mon, 16 Nov 2026 02:00:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794790824; x=1795395624; darn=lists.proxmox.com; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=n/5CjbGpRDCMa//vRuS+HM75e07nhSduFF3/VFKgkTg=; b=YOPVXnAeC96/TNHQwDLMn/231xARyRMTy3a+5sy8g5M90csslrk32B9H2yhpR6AiW2 mJ1VXUWGEEPwu21aqY7Lnrvc8bs2ANNjpSAZo+/Ck9yUJGx1UZ/I1zGVoTsRcZ2d6+4o //sb5mYQABZjV1NGHGs2YgfvsSZ+Ei+BJG5Ix1yCCR27Pqfe18AmV/x43lOTYoAvYp6x SsIGNFEHHq4GtkJ9ilKcoqPItMkXQ6bpgLXT0iU1ffEKxgyqYAfbS2WCgBLNgtX1Kbsg XmK1LEA661+xx23EciaipWQ1e6l9bC8o6hhpB8lRZao/WOIM4fy6MrzlnUno8bA/lgmE hwiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794790824; x=1795395624; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=n/5CjbGpRDCMa//vRuS+HM75e07nhSduFF3/VFKgkTg=; b=DZdBZgoEj6U1YE+aq/iVyuDYCexbnyC/ItWoh2dA95GU52DQUpoKNFEwb2uVOng330 BBJctPfdxQ+K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BPhL3dAGsMuUS/j+aQzQT Kdl6odMH4AucNT81cKnly2VT+9u3YSY6VpZ67nVq3 X-Received: by 2002:a05:6122:2906:b0:5ea:c3bc:c54b with SMTP id 71dfb90a1353d-5ee34a512c0mr2101518e0c.3.1794790824004; Sun, 15 Nov 2026 17:00:24 -0800 (PST) From: Lucas Barros To: pve-devel@lists.proxmox.com Subject: [PATCH cluster v2 1/3] setup: node certificate: only use the first search domain for the FQDN Date: Sun, 15 Nov 2026 22:00:11 -0300 Message-ID: <20261116010014.88737-2-lucasbarros.kam@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20261116010014.88737-1-lucasbarros.kam@gmail.com> References: <20261116010014.88737-1-lucasbarros.kam@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.100 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: B625UVTH6JRD6RYCBLVFRODD4NAVQQ3W X-Message-ID-Hash: B625UVTH6JRD6RYCBLVFRODD4NAVQQ3W X-MailFrom: lucasbarros.kam@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: t.lamprecht@proxmox.com, Lucas Barros X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The certificate of a node gets the node name plus the search domain of /etc/resolv.conf as subject CN and as DNS subject alternative name. The search line can list multiple domains, and once the resolv.conf parser in pve-common returns all of them, appending the whole list results in a certificate with 'CN=node.a.example b.example' and a SAN with the same, invalid, DNS name. Use only the first domain. That is what the certificate got so far, as the parser only returned the first domain, and it is the domain the installer writes, so for the common setups it is the domain the node lives in. Signed-off-by: Lucas Barros --- changes since v1: * new patch: with 3/3 applied alone, the certificate got 'CN=node.a.example b.example c.example' and the same invalid name as DNS SAN, as Thomas pointed out Using the first domain keeps today's certificates, as the parser only returned that one so far. I also looked at the canonical name from getaddrinfo() (PVE::Tools::get_fqdn()), but that can change the CN on nodes where /etc/hosts or DNS do not match resolv.conf, so I kept the current source. This has to be applied before 3/3, or pve-common needs a Breaks on older pve-cluster. Tested with 'pvecm updatecerts --force' on a PVE 9 node with three search domains, see the cover letter. This patch was prepared with the help of an LLM based coding assistant; I reviewed the change and ran the tests mentioned above myself. src/PVE/Cluster/Setup.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/PVE/Cluster/Setup.pm b/src/PVE/Cluster/Setup.pm index 8a398d3..f6cc689 100644 --- a/src/PVE/Cluster/Setup.pm +++ b/src/PVE/Cluster/Setup.pm @@ -640,8 +640,9 @@ sub gen_pve_ssl_cert { my $fqdn = $nodename; my $rc = PVE::INotify::read_file('resolvconf'); - if ($rc && $rc->{search}) { - $fqdn .= ".$rc->{search}"; + # the search list can hold more than one domain, only the first one is used for the FQDN + if ($rc && (my ($domain) = split(' ', $rc->{search} // ''))) { + $fqdn .= ".$domain"; $names .= ",DNS:$fqdn"; } -- 2.50.1 (Apple Git-155)