fixing bug when disabling use_ssl (for full ssl hosting)

regarding our conversation today, i propose this fix for ssl switch problem