Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Cache] phpredis: Added full TLS support for RedisCluster#40882
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
carsonbot commentedApr 20, 2021
Hey! I see that this is your first PR. That is great! Welcome! Symfony has acontribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
jderusse left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Do you think it's possible to add test for this?
I'm not sureRedisClusterNodeProxy is related to adding tls support?
jackthomasatl commentedApr 20, 2021
Sure. I think I can come up with tests. The issue this is addressing is that when you're using redis cluster, and getHosts gets called, it makes a new Redis object for each redis cluster node and runs commands intended just for that node via this secondary connection. The problem with that, is that when you call _masters on a RedisCluster, it does not indicate if tls is used or not. The secondary connections will be setup without tls. I've looked over the phpredis code and it does not expose in any way if its using tls or not. The easy fix for this is to just reuse the connections that RedisCluster already has to each node, using the method described in the phpredis documentation. RedisClusterNodeProxy provides a structure to encapsulate the method calls to \RedisCluster using the same interface that \Redis presents. |
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Good catch. Can you please rebase+target 4.4? This is a bugfix.
Here are some comments before merging.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
jackthomasatl commentedApr 22, 2021
Rebased against 4.4 |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for the smooth cooperation, that's a nice fix, I learned a few things about phpredis :)
jackthomasatl commentedApr 22, 2021
Very welcome! |
jackthomasatl commentedApr 22, 2021
@nicolas-grekas What about psalm? I'm not sure what its upset about. |
nicolas-grekas commentedApr 22, 2021
psalm is drunk here, it can be ignored :) |
jackthomasatl commentedApr 22, 2021
What is remaining? |
jackthomasatl commentedApr 22, 2021
Can someone approve workflows? |
jackthomasatl commentedApr 23, 2021
I switched the default value for ssl back to null. I start seeing client disconnects / timeouts when the value provided is an empty array. In the C++ code its default null. I think the presence of the array at all forces the driver into ssl mode. |
nicolas-grekas commentedApr 23, 2021
Thank you@jackthomasatl. |
…(jackthomasatl)This PR was squashed before being merged into the 4.4 branch.Discussion----------[Cache] phpredis: Added full TLS support for RedisCluster| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets | -| License | MIT| Doc PR | n/aThis Pr bridges the gap for full TLS support when using phpredis driver implementation of TLS.Adds the 'ssl' options array for cache configuration when using RedisClusterhttps://www.php.net/manual/en/context.ssl.phpSwitches directed node commands from using individual \Redis connections to using the recommended implementation from the phpredis documentation:https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#directed-node-commandsThis pr will enable compatibility with Amazon ElastiCache redis cluster mode using In Transit encryption (TLS) using the phpredis driver, Supports tagging & binary data types.Commits-------a1e0408 [Cache] phpredis: Added full TLS support for RedisCluster
nicolas-grekas commentedApr 23, 2021
(dunno why github displays this has having no commits, but the merge is confirmed inf8518ca) |
jackthomasatl commentedApr 23, 2021
Ah, I did an empty merge commit trying to trigger the test suite to run again, it was stuck. |
Uh oh!
There was an error while loading.Please reload this page.
This Pr bridges the gap for full TLS support when using phpredis driver implementation of TLS.
Adds the 'ssl' options array for cache configuration when using RedisCluster
https://www.php.net/manual/en/context.ssl.php
Switches directed node commands from using individual \Redis connections to using the recommended implementation from the phpredis documentation:
https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#directed-node-commands
This pr will enable compatibility with Amazon ElastiCache redis cluster mode using In Transit encryption (TLS) using the phpredis driver, Supports tagging & binary data types.