/**
  * Constructor
  *
  * @param   string host hostname or IP address
  * @param   int port
  * @param   resource socket default NULL
  * @param   int version default NULL
  */
 public function __construct($host, $port, $socket = null, $version = null)
 {
     parent::__construct($host, $port, $socket);
     switch ($version) {
         case 2:
             $this->cryptoImpl = STREAM_CRYPTO_METHOD_SSLv2_CLIENT;
             break;
         case 3:
             $this->cryptoImpl = STREAM_CRYPTO_METHOD_SSLv3_CLIENT;
             break;
         default:
             $this->cryptoImpl = STREAM_CRYPTO_METHOD_SSLv23_CLIENT;
             break;
     }
 }
Example #2
0
 /**
  * Constructor
  *
  * @param   string host hostname or IP address
  * @param   int port
  * @param   resource socket default NULL
  */
 public function __construct($host, $port, $socket = null)
 {
     parent::__construct($host, $port, $socket);
     $this->_prefix = 'tls://';
 }
Example #3
0
 /**
  * Constructor
  *
  * @param   string host hostname or IP address
  * @param   int port
  * @param   resource socket default NULL
  * @param   int version default NULL
  */
 public function __construct($host, $port, $socket = null, $version = null)
 {
     parent::__construct($host, $port, $socket);
     $this->_prefix = 'ssl' . ($version ? 'v' . $version : '') . '://';
 }
 /**
  * Constructor
  *
  * @param   string host hostname or IP address
  * @param   int port
  * @param   resource socket default NULL
  */
 public function __construct($host, $port, $socket = null)
 {
     parent::__construct($host, $port, $socket);
     $this->cryptoImpl = STREAM_CRYPTO_METHOD_TLS_CLIENT;
 }