fixed ssl function to not reject unauthorized certs