Comments (13)
Hi,
Adding check for !empty($ssl_options)
into AMQPSSLConnection fixes the problem.
if (!empty($ssl_options) && !isset($ssl_options['verify_peer'])) {
$ssl_options['verify_peer'] = true;
}
I'll send this to php-amqplib also a bit later.
Thanks to you!
-Olli
from laravel-amqp.
Hi,
Without further investigation my first try would be to set 'ssl' to null in options which should trigger the empty condition. (as long as $ssl_protocol = null matches it should work without ssl)
But maybe we also have a look into our connect() method which directly use AMQPSSLConnection.
-skdo
from laravel-amqp.
Hi,
It seems that setting 'ssl_options' => ['ssl' => null]
is not enough. I'll try to find the place where ssl is forced and i'll inform you if i find something.
-Olli
from laravel-amqp.
Hi,
you might be right. We most likely need to add the new constructor parameter otherwise it's always set to ssl.
Here is the problem: https://github.com/bschmitt/laravel-amqp/blob/master/src/Request.php#L43
As a test, can you change that directly on your side and add an additional null? So it must look like this afterwards:
$this->connection = new AMQPSSLConnection(
$this->getProperty('host'),
$this->getProperty('port'),
$this->getProperty('username'),
$this->getProperty('password'),
$this->getProperty('vhost'),
$this->getProperty('ssl_options'),
$this->getProperty('connect_options'),
null
);
If that works we might need to add some more ssl configuration there.
Do you have any idea why they introduced redundant configuration there? Seems like they want ssl as a sane default which would make sense but breaks stuff.
-skdo
from laravel-amqp.
Hi,
I just tried to add that extra null as well but it wouldn't help. I think the problem might be somewhere even deeper.
I think they had a problem when someone wanted to use tls
and at the same time they introduced this $ssl_protocol
parameter defaulting to ssl
.
-Olli
from laravel-amqp.
Hi,
This piece of code in constructor of AMQPSSLConnection
causes that $options['ssl'] is always set and not empty.
if (!isset($ssl_options['verify_peer'])) {
$ssl_options['verify_peer'] = true;
}
This enforces SSL to be used always. I have no quick fix for this :) Maybe it is a problem in their side.
-Olli
from laravel-amqp.
@olanko Thank you for the clarification.
I would like them to fix this problem prior to us. As we just consume them.
What do you think? Is this closed on our side?
This might also be a feature request to use tls instead of ssl which should not be possible without further enhancement.
from laravel-amqp.
Yes, I would consider this closed in here. I'm just writing an issue on their side.
-Olli
from laravel-amqp.
Thanks. Please don't hesitate to link the issue you create here so we can track this further.
from laravel-amqp.
Hi,
PR is here: php-amqplib/php-amqplib#674 and issue report here php-amqplib/php-amqplib#672
-Olli
from laravel-amqp.
Their comment was simple that why to use AMQPSSLConnection
if ssl is not defined. I understand their point and I think I know the reason why it is done this way after all.
I'll fix our problem locally for now and hope you'll find a solution some day :)
All the best,
-Olli
from laravel-amqp.
Thanks for your efforts, I'm gonna prepare a PR later today. The handy thing with the old implementation was that you could define by configuration if you want to use SSL or not.
from laravel-amqp.
New version 2.0.4
has been published.
from laravel-amqp.
Related Issues (20)
- Azure Service Bus - Support HOT 2
- Broken pipe or closed connection HOT 2
- Looking for help HOT 1
- PHP 8 support HOT 2
- AmazonMQ support HOT 1
- Target class [Amqp] does not exist. HOT 1
- Option for 'x-queue-type' HOT 1
- Configure RabbitMQ - Cluster HOT 1
- How to set initial durable for exchange HOT 1
- Non-static method 'consume' should not be called statically HOT 1
- PhpAmqpLib\Exception\AMQPInvalidFrameException: Invalid frame type 21 in /var/www/rabbit/php/app-rabbit/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Connection/AbstractConnection.php:606
- Unit Tests Schema update
- Support to set queue max length
- Wildcard Routing
- How to return the results via APi to the user when listening consume in the laravel controller HOT 1
- Publish multiple messages - Batch publish HOT 10
- [Question]open and close connections or channels every time when publish message HOT 1
- Publisher and Consumer should not be singletons HOT 2
- Consumer priority HOT 1
- Version 2.0.11 doesn't work on PHP bellow 7.4 version HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-amqp.