fixed ssl bug in connect