From 396d5c4567cf969e2b5e30b38ca0e3d5a9a05f2d Mon Sep 17 00:00:00 2001 From: GeorgII <52407577+GeorgII-web@users.noreply.github.com> Date: Tue, 18 Jul 2023 11:36:32 +0300 Subject: [PATCH] Fix custom connection parameters usage for a ssl_context option to properly create stream context --- RabbitMq/AMQPConnectionFactory.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/RabbitMq/AMQPConnectionFactory.php b/RabbitMq/AMQPConnectionFactory.php index 3ac8289d..ea3db63d 100644 --- a/RabbitMq/AMQPConnectionFactory.php +++ b/RabbitMq/AMQPConnectionFactory.php @@ -53,16 +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()); - } } /**