Exemplo n.º 1
0
 /**
  * Should be private, but... php sucks!
  * DO NOT RUN IT, TRUST ME.
  *
  * @param XmppClient $client
  * @param Stanza     $result
  *
  * @throws \RuntimeException
  * @internal
  */
 public function _onTls(XmppClient $client, Stanza $result)
 {
     if ($result->tag == 'proceed') {
         if ($this->logger) {
             $this->logger->info('TLS Connection established.');
         }
         $this->connector->startTls();
         $this->connector->streamRestart($this->jid);
     } else {
         throw new \RuntimeException('Tls negotiation failed.');
     }
 }