Raising an appropriate error if host or port are not specified.
Without this change, an incomprehensible error is raised about can't convert nil to string.
#188508