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

Doesn't work with Heroku Redis (TLS required, Redis 6+) #224

Closed
timkelty opened this issue Feb 17, 2021 · 12 comments
Closed

Doesn't work with Heroku Redis (TLS required, Redis 6+) #224

timkelty opened this issue Feb 17, 2021 · 12 comments
Labels

Comments

@timkelty
Copy link

timkelty commented Feb 17, 2021

Production plans of Heroku Redis now require a TLS connection: https://devcenter.heroku.com/articles/heroku-redis#create-a-new-instance

However, enabling via useSSL => true does not work with these Redis instances.

What steps will reproduce the problem?

  • Configure redis component with Heroku Redis 6+.
  • useSSL => true

What's expected?

Connection should work.

What do you get instead?

stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed

Additional info

Q A
Yii vesion 2.0.40
PHP version 7.4
@yii-bot
Copy link

yii-bot commented Feb 17, 2021

Thank you for your question.
In order for this issue tracker to be effective, it should only contain bug reports and feature requests.

We advise you to use our community driven resources:

If you are confident that there is a bug in the framework, feel free to provide information on how to reproduce it. This issue will be closed for now.

This is an automated comment, triggered by adding the label question.

@yii-bot yii-bot closed this as completed Feb 17, 2021
@samdark
Copy link
Member

samdark commented Feb 17, 2021

Configure your PHP properly:

  1. Download https://curl.haxx.se/ca/cacert.pem
  2. Specify path to the file in php.ini, openssl.cafile="/path/to/cacert.pem".
  3. Restart PHP.

@timkelty
Copy link
Author

Thanks @samdark, I'll give it a try!

FWIW, it looks like Heroku just made this change recently, so it will likely become relevant to anyone running Yii/Craft on Heroku Redis.

@SerotoninaAbad
Copy link

Hi @timkelty. Did you manage to find a solution to that problem in Heroku?

@timkelty
Copy link
Author

@SerotoninaAbad Ended up going with the dumb/easy solution: ditch Heroku Redis and use their "Redis To Go" add-on, which doesn't require tls.

@boboldehampsink
Copy link

Configure your PHP properly:

  1. Download https://curl.haxx.se/ca/cacert.pem
  2. Specify path to the file in php.ini, openssl.cafile="/path/to/cacert.pem".
  3. Restart PHP.

@dzuelke is this something that needs to be done in the buildpack?

@boboldehampsink
Copy link

Can this be worked around now that #227 is released?

@michaelroper
Copy link

Got bitten by this one today too, and can't use @timkelty's solution.. has anyone else managed to get a connection working to Heroku Redis?

@boboldehampsink
Copy link

boboldehampsink commented May 12, 2021

Got it working by using this in the config:

            'useSSL' => true,
            'contextOptions' => [
                'ssl' => [
                    'verify_peer' => false,
                    'verify_peer_name' => false,
                ],
            ],

@samdark
Copy link
Member

samdark commented May 12, 2021

As I previously said, #224 (comment) should be done instead of turning off peer verification.

@boboldehampsink
Copy link

@samdark that is only if you have control over the php installation

@bizley
Copy link
Member

bizley commented May 12, 2021

Guys, it's 2021... Change your provider. Anyway, this should be continued at forum if at all.

@yiisoft yiisoft locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants