Skip to content

Commit

Permalink
Fix for creating a stream context from a custom user parameters (#711)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
GeorgII-web authored Oct 31, 2023
1 parent 3a082c1 commit abe69ad
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions RabbitMq/AMQPConnectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

}

/**
Expand Down

0 comments on commit abe69ad

Please sign in to comment.