Fix https mode (issue #4086)