use auth_handler to specify host header value if possible
a more robust test for the function
re-factored patch to make it more testable, added unit test
Merge pull request #1862 from dkavanagh/fix-v4-host-header

Use auth_handler to specify host header value including custom ports if possible, which are used by Eucalyptus. Fixes #1862.