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] Fix Redis TLS schemerediss for Redis connection#39599
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
[Cache] Fix Redis TLS schemerediss for Redis connection#39599
Uh oh!
There was an error while loading.Please reload this page.
Conversation
carsonbot commentedDec 21, 2020
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 |
njutn95 commentedDec 22, 2020
Tested the code, and it's working. |
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.
would be great to use the github action test suite and one of the running container to provide functional tests.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
jderusse commentedDec 22, 2020
If we add a new parameter |
njutn95 commentedDec 22, 2020
There really is no difference between |
jderusse commentedDec 22, 2020
From thepredis Readme:
IMHO the fix should be about keeping the scheme defined here: symfony/src/Symfony/Component/Cache/Traits/RedisTrait.php Lines 93 to 97 in6dc5fea
And use that scheme in the relevant places:
|
njutn95 commentedDec 22, 2020
For |
misaert commentedDec 22, 2020
And it doesn't work with the same DSN on Symfony Messenger because ofhttps://github.com/symfony/messenger/blob/5.x/Transport/TransportFactory.php#L46: |
jderusse commentedDec 22, 2020
I don't have strong opinion about
Given The RedisTrait didn't work, maybe it's easier to deprecate the |
njutn95 commentedDec 22, 2020
I've created a PR to add |
derrabus commentedDec 22, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
For reference, a codebase I took over recently uses this bundle to configure their redis connections:https://github.com/snc/SncRedisBundle The developers told me that they in favor of that bundle mainly because it allowed them to configure TLS connections, which is a requirement when using the managed Redis services of our current hoster Digital Ocean. Our DSNs are all configured with the |
njutn95 commentedDec 22, 2020
SncRedisBundle is indeed reading the TLS configuration from the |
Uh oh!
There was an error while loading.Please reload this page.
misaert commentedDec 24, 2020
For now, I changed the code to support both. |
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.
Eithertls option should not be added here,rediss scheme should be deprecated.
We should not support both.
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.
misaert commentedDec 25, 2020
To be consistent with#39607, I keep the |
rediss for Redis connectionUh oh!
There was an error while loading.Please reload this page.
stof commentedFeb 17, 2021
@nicolas-grekas I would vote for merging that in 4.4 as a bugfix, as symfony/cache claims to support |
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.
(I rebased on 4.4, cleaned up implementation a bit and fixed tests)
… to Redis transport (njutn95)This PR was squashed before being merged into the 5.3-dev branch.Discussion----------[Messenger] Add `rediss://` DSN scheme support for TLS to Redis transport| Q | A| ------------- | ---| Branch? | 5.x| Bug fix? | no| New feature? | no| Deprecations? | yes| Tickets || License | MIT| Doc PR |This adds a support for `rediss://` DSN (as discussed in#39599) and deprecates the use of `tls` parameter introduced in#35503 so it can be standardized to single format.Commits-------28e7b74 [Messenger] Add `rediss://` DSN scheme support for TLS to Redis transport
This PR was merged into the 4.4 branch.Discussion----------[Cache] Add TLS scheme for Redis connectionSeesymfony/symfony#39599.Commits-------2d2f3b7 [Cache] Add TLS scheme for Redis connection
Uh oh!
There was an error while loading.Please reload this page.
Like#35503 on Symfony Messenger, this will enable TLS support for Redis adapter.
The implementation just prefix the host with
tls://as described here:https://github.com/phpredis/phpredis#connect-openI don't know how to test it because I guess I need a TLS Redis in
src/Symfony/Component/Cache/Tests/Adapter/RedisAdapterTest.php.