From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <t.lamprecht@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 59C3074189
 for <pve-devel@lists.proxmox.com>; Mon, 21 Jun 2021 09:36:49 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 475FC188F4
 for <pve-devel@lists.proxmox.com>; Mon, 21 Jun 2021 09:36:19 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS id 863C0188E7
 for <pve-devel@lists.proxmox.com>; Mon, 21 Jun 2021 09:36:17 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 5915740C0C
 for <pve-devel@lists.proxmox.com>; Mon, 21 Jun 2021 09:36:17 +0200 (CEST)
Message-ID: <037fce3d-26a1-34e0-6d0d-0b7a3f567aff@proxmox.com>
Date: Mon, 21 Jun 2021 09:36:08 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101
 Thunderbird/90.0
Content-Language: en-US
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
 Stoiko Ivanov <s.ivanov@proxmox.com>
References: <20210512190452.22885-1-s.ivanov@proxmox.com>
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
In-Reply-To: <20210512190452.22885-1-s.ivanov@proxmox.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.758 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
Subject: [pve-devel] applied: [PATCH proxmox-acme] fix #3390: standalone:
 explicitly bind to '::'
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Mon, 21 Jun 2021 07:36:49 -0000

On 12.05.21 21:04, Stoiko Ivanov wrote:
> This patch follows 2f8be3bfda203065b22e60862e5f98d831a46921 from
> pve-common:
> Instead of not specifying a listen address, we first try to bind on
> '::', which usually accepts connections for both ipv4 and ipv6,
> and fall back to '0.0.0.0' if this fails (if ipv6 is disabled via
> kernel commandline).
> 
> The arguments are the same for HTTP::Daemon as for IO::Socket::IP,
> since the former has IO::Socket::IP as base.
> 
> Additionally, by setting 'V6Only' explicitly to '0', the listening
> socket will also accept ipv4 connections, even if the sysctl
> 'net.ipv6.bindv6only' is set to 1 - the sysctl provides a default
> value, which can be overridden by a socket-option (see ipv6(7) -
> IPV6_ONLY).
> 
> setting this option results in the following setsockopt-call being
> added:
> setsockopt(3, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0
> 
> AFAICT the socket option is available and overridable on Linux > 2.4
> see [0] for an explanation of why this might not be wanted
> 
> Overriding the default setting set by an admin might be debateable,
> but considering that the http-listener for the ACME challenge is
> rather short-lived I think this is justified. The only other option
> would be to create 2 listening sockets and binding on both - which
> would mean reorganizing our perl-deamons to deal with multiple listen
> sockets.
> 
> quickly tested on a publicly reachable test-machine of mine with:
> * ipv6.domain.test (only AAAA record)
> * ip46.domain.test (both AAAA and A)
> * ipv4.domain.test (only A record)
> with:
> * sysctl net.ipv6.bindv6only=1 (for all 3 domains)
> * disabling ipv6 via kernel-commandline (only ipv4 tested)
> * disabling ipv6 via sysctl (only ipv4 tested)
> * only configuring an ipv6 address (only ipv6 tested)
> 
> [0] https://man.openbsd.org/inet6.4
> Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
> ---
>  src/PVE/ACME/StandAlone.pm | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
>

applied, thanks!