Signed-off-by: Dmitry Smirnov <onlyjob@member.fsf.org>
Based on code from discovery/srv.go. The returns the target as DNS returns it. In the case of SSL, certs are tied to the hostname and not the IP address generally. Solves #2547