File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ Add connection to config/queue.php:
5050 'lazy' => env('RABBITMQ_LAZY_CONNECTION', true),
5151 'keepalive' => env('RABBITMQ_KEEPALIVE_CONNECTION', false),
5252 'heartbeat' => env('RABBITMQ_HEARTBEAT_CONNECTION', 0),
53+ 'secure' => env('RABBITMQ_SECURE', false),
5354 ],
5455
5556 'options' => [
Original file line number Diff line number Diff line change 1313 'lazy ' => env ('RABBITMQ_LAZY_CONNECTION ' , true ),
1414 'keepalive ' => env ('RABBITMQ_KEEPALIVE_CONNECTION ' , false ),
1515 'heartbeat ' => env ('RABBITMQ_HEARTBEAT_CONNECTION ' , 0 ),
16+ 'secure ' => env ('RABBITMQ_SECURE ' , false ),
1617 ],
1718
1819 'options ' => [
Original file line number Diff line number Diff line change @@ -30,13 +30,16 @@ public function connect(array $config = []): Queue
3030 $ amqpConnectionConfig ->setIsLazy (config ('queue.connections.rabbitmq.hosts.lazy ' ));
3131 $ amqpConnectionConfig ->setKeepalive (config ('queue.connections.rabbitmq.hosts.keepalive ' ));
3232 $ amqpConnectionConfig ->setHeartbeat (config ('queue.connections.rabbitmq.hosts.heartbeat ' ));
33+ $ amqpConnectionConfig ->setIsSecure (config ('queue.connections.rabbitmq.hosts.secure ' ));
3334
3435 // set SSL Options
35- $ amqpConnectionConfig ->setSslCaCert (config ('queue.connections.rabbitmq.options.ssl_options.cafile ' ));
36- $ amqpConnectionConfig ->setSslCert (config ('queue.connections.rabbitmq.options.ssl_options.local_cert ' ));
37- $ amqpConnectionConfig ->setSslKey (config ('queue.connections.rabbitmq.options.ssl_options.local_key ' ));
38- $ amqpConnectionConfig ->setSslVerify (config ('queue.connections.rabbitmq.options.ssl_options.verify_peer ' ));
39- $ amqpConnectionConfig ->setSslPassPhrase (config ('queue.connections.rabbitmq.options.ssl_options.passphrase ' ));
36+ if ($ amqpConnectionConfig ->isSecure ()) {
37+ $ amqpConnectionConfig ->setSslCaCert (config ('queue.connections.rabbitmq.options.ssl_options.cafile ' ));
38+ $ amqpConnectionConfig ->setSslCert (config ('queue.connections.rabbitmq.options.ssl_options.local_cert ' ));
39+ $ amqpConnectionConfig ->setSslKey (config ('queue.connections.rabbitmq.options.ssl_options.local_key ' ));
40+ $ amqpConnectionConfig ->setSslVerify (config ('queue.connections.rabbitmq.options.ssl_options.verify_peer ' ));
41+ $ amqpConnectionConfig ->setSslPassPhrase (config ('queue.connections.rabbitmq.options.ssl_options.passphrase ' ));
42+ }
4043
4144 // Create AMQP Connection
4245 $ connection = AMQPConnectionFactory::create ($ amqpConnectionConfig );
You can’t perform that action at this time.
0 commit comments