Improoved HSTS support

bug 901909
bug 946705
bug 946697
Updated all links to https