"HTTP Request Defaults" Config Element accepts space ending "Port Number" and causes "HTTP Request" Sampler run into "Connection refused: connect". Maybe "HTTP Request" Sampler can trim space before connecting. Copy/Paste very easily leaves a space at the end of "HTTP Request Defaults" Config Element "Port Number" input. "HTTP Request" Sampler runs into "Connection refused: connect" without logging any hint wrt the space. Internet search led to NAT support limitation. Wasted many time struggling w/ firewall, proxy & tunnelling. Thanks.
"HTTP Request" Sampler parameter "Value" also accepts (ending) space and directly puts it into HTTP request w/o URL-encoding. Maybe "HTTP Request" Sampler can either trim space or URL-encoding at least. Thanks.
I don't consider these to be bugs as JMeter behaves correctly when correct data is provided. In the case of spaces in parameter values, they are encoded if encoding is selected. No change is needed there. However, I agree it would be useful to ignore trailing spaces for the port field. At present the port is ignored if it is not a valid number. This is a bit confusing - but not a bug - so I'm changing this report to an enhancement.
Trailing port spaces have been fixed in SVN r600547.
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2048