Please keep using the full ip address when not in ssl mode. The if condition above should set the full $host:

   if (..) {
       $host = 'ssl://' . $this->options['host'];
   } else {
        $host = $this->options['ip'];
   }