Use URI::Generic#hostname to trim [] from ipv6 addresses.

URI::Generic#host is not appropriate to pass socket methods such as TCPSocket.open.

See: https://bugs.ruby-lang.org/issues/3788
From above, URI::Generic#hostname was added in ruby 1.9.3.
Commit: https://github.com/ruby/ruby/commit/5fd45a4b79dd26f9e7b6dc41142912df911e4d7d

From: lib/uri/common.rb:

Since IPv6 addresses are wrapped by brackets in URIs,
this method returns IPv6 addresses wrapped by brackets.
This form is not appropriate to pass socket methods such as TCPSocket.open.
If unwrapped host names are required, use "hostname" method.

  URI("http://[::1]/bar/baz").host #=> "[::1]"
  URI("http://[::1]/bar/baz").hostname #=> "::1"

See also: https://github.com/nahi/httpclient/pull/176
Netrc is probably not expecting "[::1]" for ipv6 addresses.
Merge pull request #332 from ManageIQ/use_uri_hostname_to_strip_brackets_from_ipv6_hosts

Use URI::Generic#hostname to strip brackets from ipv6 hosts