Fixes to ssl support