fix ssl handling