* new: added methods `getOption`, `setOption`, `setOptions` and `getOptions` to both Client and Server, meant to replace
direct access to _all public properties_ as well as the `$timeout` argument in calls to `Client::send` and `Client::multicall`
+* new: by using `Client::setOption('extracurlopts')`, it is possible to pass in protocol=specific options for when
+ using the Socket http transport. The value has to be an array with key being 'socket' or 'ssl', and the value an array
+ (see https://www.php.net/manual/en/context.socket.php and https://www.php.net/manual/en/context.ssl.php)
+
* new: it is now possible to inject a custom logger into helper classes `Charset`, `Http`, `XMLParser`, inching a step
closer to supporting DIC patterns (issue #78)
const OPT_COOKIES = 'cookies';
const OPT_DEBUG = 'debug';
const OPT_EXTRA_CURL_OPTS = 'extracurlopts';
+ const OPT_EXTRA_SOCKET_OPTS = 'extrasockopts';
const OPT_KEEPALIVE = 'keepalive';
const OPT_KEY = 'key';
const OPT_KEY_PASS = 'keypass';
* @var array
*/
protected $cookies = array();
+ /**
+ * @var array
+ */
+ protected $extrasockopts = array();
/**
* @var array
*/
$contextOptions['ssl']['verify_peer_name'] = $opts['verifypeer'];
}
+ foreach ($opts['extracurlopts'] as $proto => $protoOpts) {
+ foreach ($protoOpts as $key => $val) {
+ $contextOptions[$proto][$key] = $val;
+ }
+ }
+
$context = stream_context_create($contextOptions);
if ($opts['timeout'] <= 0) {
$this->client->setSSLVersion($this->args['SSLVERSION']);
$this->client->setUseCurl(\PhpXmlRpc\Client::USE_CURL_NEVER);
+ if (version_compare(PHP_VERSION, '8.0', '>'))
+ {
+ $version = explode('.', PHP_VERSION);
+ $this->client->setOption(\PhpXmlRpc\Client::OPT_EXTRA_SOCKET_OPTS,
+ array('ssl' => array('security_level' => 2 + $version[1])));
+ }
+
$this->$method();
}