From abe69adf53e08145b00d3e23cbf71126c4fd259e Mon Sep 17 00:00:00 2001 From: GeorgII <52407577+GeorgII-web@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:37:43 +0300 Subject: [PATCH] Fix for creating a stream context from a custom user parameters (#711) * Fix custom connection parameters usage for a ssl_context option * Fix custom connection parameters usage for a ssl_context option to properly create stream context --- RabbitMq/AMQPConnectionFactory.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/RabbitMq/AMQPConnectionFactory.php b/RabbitMq/AMQPConnectionFactory.php index 0ff6fff9..851472f5 100644 --- a/RabbitMq/AMQPConnectionFactory.php +++ b/RabbitMq/AMQPConnectionFactory.php @@ -53,15 +53,17 @@ public function __construct( $this->parameters['hosts'][$key] = $this->parseUrl($hostParameters); } - + + if ($parametersProvider) { + $this->parameters = array_merge($this->parameters, $parametersProvider->getConnectionParameters()); + } + if (is_array($this->parameters['ssl_context'])) { $this->parameters['context'] = !empty($this->parameters['ssl_context']) ? stream_context_create(['ssl' => $this->parameters['ssl_context']]) : null; } - if ($parametersProvider) { - $this->parameters = array_merge($this->parameters, $parametersProvider->getConnectionParameters()); - } + } /**