rearranged ssl stuff a bit more