git » gofer » commit 035cf71

test: Remove IDNA support from generate_cert.go

author Alberto Bertogli
2022-03-20 10:56:24 UTC
committer Alberto Bertogli
2022-03-20 11:11:32 UTC
parent ea6e7b4ded1d50bec8b69a53fb58856add664e27

test: Remove IDNA support from generate_cert.go

IDNA support in generate_cert.go is not used, since we only generate
certs for `localhost`, and introduces an unnecessary dependency.

test/util/generate_cert.go +1 -9

diff --git a/test/util/generate_cert.go b/test/util/generate_cert.go
index 4fbf706..678c3fa 100644
--- a/test/util/generate_cert.go
+++ b/test/util/generate_cert.go
@@ -23,8 +23,6 @@ import (
 	"os"
 	"strings"
 	"time"
-
-	"golang.org/x/net/idna"
 )
 
 var (
@@ -83,13 +81,7 @@ func main() {
 		if ip := net.ParseIP(h); ip != nil {
 			template.IPAddresses = append(template.IPAddresses, ip)
 		} else {
-			// We use IDNA-encoded DNS names, otherwise the TLS library won't
-			// load the certificates.
-			ih, err := idna.ToASCII(h)
-			if err != nil {
-				log.Fatalf("host %q cannot be IDNA-encoded: %v", h, err)
-			}
-			template.DNSNames = append(template.DNSNames, ih)
+			template.DNSNames = append(template.DNSNames, h)
 		}
 	}