Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 89e2d1d

Browse files
author
Olivier Dolbeau
committed
Remove TLS related options when not using TLS
1 parent d4844ef commit 89e2d1d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/Messenger/Bridge/Amqp/Transport/Connection.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ public static function fromDsn(string $dsn, array $options = [], AmqpFactory $am
219219
return $queueOptions;
220220
}, $queuesOptions);
221221

222+
if (!$useAmqps) {
223+
unset($amqpOptions['cacert'], $amqpOptions['cert'], $amqpOptions['key'], $amqpOptions['verify']);
224+
}
225+
222226
if ($useAmqps && !self::hasCaCertConfigured($amqpOptions)) {
223227
throw new InvalidArgumentException('No CA certificate has been provided. Set "amqp.cacert" in your php.ini or pass the "cacert" parameter in the DSN to use SSL. Alternatively, you can use amqp:// to use without SSL.');
224228
}

0 commit comments

Comments
 (0)