Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #672: Changes in SSL handling breaks bschmitt/laravel-amqp #674

Closed
wants to merge 1 commit into from
Closed

Conversation

olanko
Copy link

@olanko olanko commented Apr 4, 2019

Referring to issue #672

Automatically setting $ssl_options['verify_peer'] = true breaks bschmitt/laravel-amqp which sends empty ssl_options when ssl is not enabled. Setting verify_peer enforces ssl later in PhpAmqpLib/Wire/IO/StreamIO.php even if it is not what the user wants.

Simply checking if $ssl_options is defined fixes this problem.

@lukebakken
Copy link
Collaborator

Setting verify_peer enforces ssl later in PhpAmqpLib/Wire/IO/StreamIO.php even if it is not what the user wants.

I'm not opposed to this change, but why would someone use AMQPSSLConnection if they didn't want to use ssl?

@olanko
Copy link
Author

olanko commented Apr 4, 2019

Hi,

I understand and kinda agree with you.

I don't know the reasoning why laravel-amqp uses this. My guess is that it has been easier to always use AMQPSSLConnection because it has actually worked with or without SSL depending on $ssl_options before this change 0f16fb8. Is that verify_peer part even related to that commit anyways?

I'll handle this case locally and hope that someone makes these libraries work together again :)

BR,
-Olli

Copy link
Member

@ramunasd ramunasd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about PHP5.5 users who does not submit options(empty $ssl_options) and expect that verify_peer is enabled for secure connection? I think we must still keep compatibility here.

@lukebakken
Copy link
Collaborator

Well, according to this old code we used to check if ssl_options were empty before creating an ssl context. Technically the change isn't backwards-compatible, even if the old behavior didn't make sense.

@ramunasd
Copy link
Member

ramunasd commented Apr 4, 2019

@lukebakken I agree, that change was not 100% backwards compatible. So we either revert it or improve to acceptable point. I think 1st option isn't nice because additional argument $ssl_protocol creates additional confusion about how variables must be passed, imagine matrix:

$ssl_options $ssl_protocol is secure?
empty empty no
empty ssl yes?
empty tls yes?
not empty empty no?
not empty ssl yes
not empty tls yes

Is this what everyone would expect? My common sense says that AMQPSSLConnection always must be secure or fail to establish connection.

I see laravel guys are adopting library to latest changes, so no big problem here?

@lukebakken
Copy link
Collaborator

My common sense says that AMQPSSLConnection always must be secure or fail to establish connection

I agree.

Anyway, at this point, let's revert to the old behavior and then ensure this is fixed in 3.0.0.

@ramunasd
Copy link
Member

ramunasd commented Apr 5, 2019

I will take care.

@olanko
Copy link
Author

olanko commented Apr 6, 2019

Hi,

Thanks for taking this seriously! Although they fixed my original problem already, you are doing good job.

-Olli

@ramunasd
Copy link
Member

ramunasd commented Apr 7, 2019

Fix on PR #677

@lukebakken
Copy link
Collaborator

Fixed by #677

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants