Try to get peer hostname from SocketAddress
Java 7 added a new method to InetSocketAddress called getHostString() which returns the unresolved host for a given address. This should be suitable for use with SNI as long as it isn't an IP address. This also helps with testing because we can use serialization tricks to rewrite the "hostname" field of an already-serialized loopback address. (cherry picked from commit bc8a290f) Bug: 27271561 Change-Id: I9845e57d505712cdfee87d18246a1a3b021deea3
Showing
Please register or sign in to comment