mirror of
https://github.com/predis/predis.git
synced 2026-08-30 04:02:22 +00:00
PHP 8.4.0 compatibility with call to stream_context_set_option (#1503)
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
This commit is contained in:
@@ -211,7 +211,11 @@ class StreamConnection extends AbstractConnection
|
||||
$options['crypto_type'] = STREAM_CRYPTO_METHOD_TLS_CLIENT;
|
||||
}
|
||||
|
||||
if (!stream_context_set_option($resource, ['ssl' => $options])) {
|
||||
$context_options = function_exists('stream_context_set_options')
|
||||
? stream_context_set_options($resource, ['ssl' => $options])
|
||||
: stream_context_set_option($resource, ['ssl' => $options]);
|
||||
|
||||
if (!$context_options) {
|
||||
$this->onConnectionError('Error while setting SSL context options');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user