This PR fixes the construction of the TLSServerName when connecting to a
node that has TLS enabled and adds tests for all possible permutations.
Fixes https://github.com/hashicorp/nomad/issues/3013
The format of the missing port error message changed from Go 1.7 to 1.8.
The fix is to just use strings.Contains instead of strings.HasPrefix
when looking for the "missing port" part.
Also add an error return to Client.newRequest as parsing the path
processes arbitrary user input and would panic if given an invalid URL.
See: https://groups.google.com/d/topic/nomad-tool/gi3-CTE7oXo/discussion