From 8056fb92e8ad8d6e27d5685b8e5ff81720f7c6df Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Fri, 11 Jun 2021 09:31:37 +0200 Subject: [PATCH] Accept IPv6 address as CN names Expand the cnRegexp to also accept ipv6 addresses such as: * ::1 * 2a00:1450:400e:80e:: * 2a00:1450:400e:80e::200e Fixes: #37 Signed-off-by: Sjoerd Simons (cherry picked from commit dc7452dbb8d0c805672eac2a71d8e0627a45c779) --- factory/gen.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/factory/gen.go b/factory/gen.go index ff15a93..1f43e67 100644 --- a/factory/gen.go +++ b/factory/gen.go @@ -26,7 +26,7 @@ const ( ) var ( - cnRegexp = regexp.MustCompile("^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$") + cnRegexp = regexp.MustCompile("^([A-Za-z0-9:][-A-Za-z0-9_.:]*)?[A-Za-z0-9:]$") ) type TLS struct {