File tree 3 files changed +10
-5
lines changed
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:
50
50
'lazy' => env('RABBITMQ_LAZY_CONNECTION', true),
51
51
'keepalive' => env('RABBITMQ_KEEPALIVE_CONNECTION', false),
52
52
'heartbeat' => env('RABBITMQ_HEARTBEAT_CONNECTION', 0),
53
+ 'secure' => env('RABBITMQ_SECURE', false),
53
54
],
54
55
55
56
'options' => [
Original file line number Diff line number Diff line change 13
13
'lazy ' => env ('RABBITMQ_LAZY_CONNECTION ' , true ),
14
14
'keepalive ' => env ('RABBITMQ_KEEPALIVE_CONNECTION ' , false ),
15
15
'heartbeat ' => env ('RABBITMQ_HEARTBEAT_CONNECTION ' , 0 ),
16
+ 'secure ' => env ('RABBITMQ_SECURE ' , false ),
16
17
],
17
18
18
19
'options ' => [
Original file line number Diff line number Diff line change @@ -30,13 +30,16 @@ public function connect(array $config = []): Queue
30
30
$ amqpConnectionConfig ->setIsLazy (config ('queue.connections.rabbitmq.hosts.lazy ' ));
31
31
$ amqpConnectionConfig ->setKeepalive (config ('queue.connections.rabbitmq.hosts.keepalive ' ));
32
32
$ amqpConnectionConfig ->setHeartbeat (config ('queue.connections.rabbitmq.hosts.heartbeat ' ));
33
+ $ amqpConnectionConfig ->setIsSecure (config ('queue.connections.rabbitmq.hosts.secure ' ));
33
34
34
35
// 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
+ }
40
43
41
44
// Create AMQP Connection
42
45
$ connection = AMQPConnectionFactory::create ($ amqpConnectionConfig );
You can’t perform that action at this time.
0 commit comments