This fixes and issue where InetAddress.toString() may return a result in the
form of "<empty>/ip-address". It is not guaranteed that a host name will always
be resolved here, therefore this may eventually lead to incorrect proxy address
(an empty string basically) being used when constructing the TlsTunnel.
In my test case, due to failing DNS lookup, the InetAddress.toString() was
always returning "/10.1.1.5" which led to proxy connection failure. This must
not be the case. The TlsTunnel should use the ip address if a host name lookup
had failed.
This fixes and issue where
InetAddress.toString()
may return a result in the form of"<empty>/ip-address"
. It is not guaranteed that a host name will always be resolved here, therefore this may eventually lead to incorrect proxy address (an empty string basically) being used when constructing the TlsTunnel.See [InetAddress.html#toString](http://download.java.net/jdk7/archive/b123/docs/api/java/net/InetAddress.html#toString())
In my test case, due to failing DNS lookup, the
InetAddress.toString()
was always returning"/10.1.1.5"
which led to proxy connection failure. This must not be the case. The TlsTunnel should use the ip address if a host name lookup had failed.This probably also addresses #285.