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

feat: add support for SSL #88

Merged
merged 1 commit into from Feb 5, 2020
Merged

Conversation

rtm-ctrlz
Copy link
Contributor

Added usage of stream_context_set_option for setting SSL options.
Added tests with certificate generation and ssl-enabled configuration for RabbitMQ.
Added some configuration examples for common use cases see examples/ssl directory.
Mentioned SSL support in main README.md.

Some notes:

  • RabbitMQ added sysctl format since 3.7.0, so there are both configuration file versions prior 3.7.0 and sysctl.
  • Tests covers only connections, any other tests should works same way as via plain tcp.
  • There is no way to detect any errors in SSL options, so in case of error we will get exception with Could not connect to... message.

Resolves #77

Copy link
Collaborator

@WyriHaximus WyriHaximus left a comment

Choose a reason for hiding this comment

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

Hey thanks for taking the time to craft this extensive PR, and it looks great, there is only one change I'd would prefer: change ssl to tls where possible.

@rtm-ctrlz
Copy link
Contributor Author

rtm-ctrlz commented Feb 3, 2020

Personally, I have no objection regarding parameter name change, but this code will not look so neat:

stream_context_set_option($context, ['ssl' => $this->options['tls']])

If you are OK with that - I'll make this change.

Also, should examples/ssl, test/ssl, variables in Makefile and filenames for RabbitMQ configs (for tests and examples) directory be renamed?

@rtm-ctrlz
Copy link
Contributor Author

See #89 ;)

@rtm-ctrlz
Copy link
Contributor Author

Synced branch jakubkulhan/bunny:master

@WyriHaximus
Copy link
Collaborator

See #89 ;)

Will have a look at it tomorrow 👍 .

@WyriHaximus
Copy link
Collaborator

Personally, I have no objection regarding parameter name change, but this code will not look so neat:

stream_context_set_option($context, ['ssl' => $this->options['tls']])

If you are OK with that - I'll make this change.

Also, should examples/ssl, test/ssl, variables in Makefile and filenames for RabbitMQ configs (for tests and examples) directory be renamed?

Yeah this suddenly makes sense looking at #89 🤐 !

Copy link
Collaborator

@WyriHaximus WyriHaximus left a comment

Choose a reason for hiding this comment

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

Comparing this with #89 made this one look less confusing regarding naming. Still would prefer TLS but this is easier to maintain 👍

@WyriHaximus WyriHaximus merged commit 2987215 into jakubkulhan:master Feb 5, 2020
@rtm-ctrlz rtm-ctrlz deleted the feat-ssl branch February 6, 2020 15:24
@fhuitelec fhuitelec mentioned this pull request Apr 27, 2020
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.

Connect using SSL protocol
2 participants