some changes for ssl handling