in common/src/main/java/org/apache/cassandra/sidecar/common/JmxClient.java [277:287]
private static String maybeAddSquareBrackets(String host)
{
if (host == null // host is null
|| host.isEmpty() // or host is empty
|| host.charAt(0) == '[' // host already starts with square brackets
|| !host.contains(":")) // or host doesn't contain ":" (not an IPv6 address)
return host;
// Use square brackets to surround IPv6 addresses to fix CASSANDRA-7669 and CASSANDRA-17581
return "[" + host + "]";
}