diff --git a/client/dial.go b/client/dial.go index 4fce2ac5bc5a1ca22eb02ab4fee91d869572b70a..d6a0342b8f0149f4cdea1f09c93634a2aeceb646 100644 --- a/client/dial.go +++ b/client/dial.go @@ -2,9 +2,11 @@ package client import ( "context" + _ "crypto/x509" // ensure x509 package init happens after this package "fmt" "net" "net/url" + "os" "time" gitaly_x509 "gitlab.com/gitlab-org/gitaly/internal/x509" @@ -110,3 +112,16 @@ func getConnectionType(rawAddress string) connectionType { return invalidConnection } } + +// respectCommonName ensures that the deprecated common name field is not +// ignored. +// For more info: https://golang.org/doc/go1.15#commonname +// TODO: remove this hack in +func respectCommonName() { + godebug := "GODEBUG" + os.Setenv(godebug, os.Getenv(godebug)+",x509ignoreCN=0") +} + +func init() { + respectCommonName() +}