diff --git a/src/Amqp/Connection.php b/src/Amqp/Connection.php index 1fd914e..b376bd8 100644 --- a/src/Amqp/Connection.php +++ b/src/Amqp/Connection.php @@ -64,6 +64,7 @@ protected function makeTopic(AmqpContext $context): Topic */ protected function makeFactory(): AmqpConnectionFactory { + $sslConfig = collect($this->config->get('ssl', [])); $factory = new AmqpConnectionFactory([ 'dsn' => $this->config->get('dsn'), 'host' => $this->config->get('host', '127.0.0.1'), @@ -71,16 +72,16 @@ protected function makeFactory(): AmqpConnectionFactory 'user' => $this->config->get('user', 'guest'), 'pass' => $this->config->get('pass', 'guest'), 'vhost' => $this->config->get('vhost', '/'), - 'ssl_on' => $this->config->get('ssl.is_enabled', false), - 'ssl_verify' => $this->config->get('ssl.verify_peer', true), - 'ssl_cacert' => $this->config->get('ssl.cafile'), - 'ssl_cert' => $this->config->get('ssl.local_cert'), - 'ssl_key' => $this->config->get('ssl.local_key'), - 'ssl_passphrase' => $this->config->get('ssl.passphrase'), + 'ssl_on' => $sslConfig->get('is_enabled', false), + 'ssl_verify' => $sslConfig->get('verify_peer', true), + 'ssl_cacert' => $sslConfig->get('cafile'), + 'ssl_cert' => $sslConfig->get('local_cert'), + 'ssl_key' => $sslConfig->get('local_key'), + 'ssl_passphrase' => $sslConfig->get('passphrase'), ]); $factory->setDelayStrategy($this->getDelayStrategy()); - + return $factory; }