IPv6: Support host address configured with enclosing square brackets (#31226)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
@@ -114,6 +114,8 @@ func (server *Server) Dial() error {
|
||||
}
|
||||
}
|
||||
for _, host := range strings.Split(server.Config.Host, " ") {
|
||||
// Remove any square brackets enclosing IPv6 addresses, a format we support for backwards compatibility
|
||||
host = strings.TrimSuffix(strings.TrimPrefix(host, "["), "]")
|
||||
address := net.JoinHostPort(host, strconv.Itoa(server.Config.Port))
|
||||
if server.Config.UseSSL {
|
||||
tlsCfg := &tls.Config{
|
||||
|
||||
Reference in New Issue
Block a user