-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSSLSocket.class.php
More file actions
executable file
·35 lines (32 loc) · 1.04 KB
/
Copy pathSSLSocket.class.php
File metadata and controls
executable file
·35 lines (32 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php namespace peer;
/**
* SSL (Secure socket layer) socket
*
* Will attempt to negotiate an SSL V2 or SSL V3 connection depending
* on the capabilities and preferences of the remote host if the SSL
* version is omitted. The constructor's version parameter can be used
* to explicitely select a specific SSL version by passing 2 or 3.
*
* @deprecated Use EncryptedSocket instead!
* @see php://transports
* @ext openssl
*/
class SSLSocket extends CryptoSocket {
/**
* 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;
}
}
}