Fix SSL connection bug