Improve fix for https support