+ # if the host is a bracketed (IPv6) address, strip the brackets
+ # since Ruby doesn't like them in the Socket host parameter
+ # FIXME it would be safer to have it check for a valid
+ # IPv6 bracketed address rather than just stripping the brackets
+ srv_host = @server_uri.host
+ if srv_host.match(/\A\[(.*)\]\z/)
+ srv_host = $1
+ end
+