Code Monkey home page Code Monkey logo

Comments (13)

olanko avatar olanko commented on July 22, 2024 2

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.

stevenklar avatar stevenklar commented on July 22, 2024

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.

olanko avatar olanko commented on July 22, 2024

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.

stevenklar avatar stevenklar commented on July 22, 2024

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.

olanko avatar olanko commented on July 22, 2024

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.

olanko avatar olanko commented on July 22, 2024

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.

stevenklar avatar stevenklar commented on July 22, 2024

@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.

olanko avatar olanko commented on July 22, 2024

Yes, I would consider this closed in here. I'm just writing an issue on their side.

-Olli

from laravel-amqp.

stevenklar avatar stevenklar commented on July 22, 2024

Thanks. Please don't hesitate to link the issue you create here so we can track this further.

from laravel-amqp.

olanko avatar olanko commented on July 22, 2024

Hi,

PR is here: php-amqplib/php-amqplib#674 and issue report here php-amqplib/php-amqplib#672

-Olli

from laravel-amqp.

olanko avatar olanko commented on July 22, 2024

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.

bschmitt avatar bschmitt commented on July 22, 2024

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.

bschmitt avatar bschmitt commented on July 22, 2024

New version 2.0.4 has been published.

from laravel-amqp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.