From 510d55c006ac44964a6b0be94c59b07090fb5a59 Mon Sep 17 00:00:00 2001 From: "Johnny S. Lee" <6614805+johnnyslee@users.noreply.github.com> Date: Mon, 21 Feb 2022 15:55:21 +0800 Subject: [PATCH] security/stunnel: Fix connect format for IPv6 addresses (#2852) The current code generates conf line: ``` connect = [::1]:53 ``` will end up producing the following: ``` Error resolving "[::1]": Neither nodename nor servname known (EAI_NONAME) ``` stunnel(8) states that an address parameter of an option may be either: > ... > A colon-separated pair of IP address (either IPv4, IPv6, or domain name) and port number. > ... which means there should not be special treatment on IPv6 addresses. --- .../opnsense/service/templates/OPNsense/Stunnel/stunnel.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf b/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf index 8c3ee5ecc..0d6590d38 100644 --- a/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf +++ b/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf @@ -18,7 +18,7 @@ logId = unique ; ************************************************************************** [{{service['@uuid']}}] accept = {% if service.accept_address %}{{service.accept_address}}:{% endif %}{{service.accept_port}} -connect = {% if service.connect_address.find(":") > -1 %}[{{service.connect_address}}]{% else %}{{service.connect_address}}{% endif %}:{{service.connect_port}} +connect = {{service.connect_address}}:{{service.connect_port}} {% if service.protocol %} protocol = {{service.protocol}} {% endif %}