Improved ssl support