Second fix for HTTPCLIENT-1296. Include Oleg's suggestions as to a better way to obtain a port from the non-existent target.