Fix handling for sources with basic auth.

Closes #3132.
Merge pull request #3137 from TimMoore/1-7-stable

Fix handling for sources with basic auth