Support for https://localhost
Merge from upstream