Fixes to make ssl work properly for test cases