Work around Phantomjs download test problem. Ensure current page is HTTPS before downloading via AJAX