简体   繁体   English

AMQPS Symfony 信使和 Heroku

[英]AMQPS Symfony Messenger and Heroku

I'm using CloudAMQP though Heroku's add-on ( https://elements.heroku.com/addons/cloudamqp ) with the « Little Lemur » plan.我通过 Heroku 的附加组件 ( https://elements.heroku.com/addons/cloudamqp ) 使用 CloudAMQP 和 « Little Lemur » 计划。 I'm building a PHP Symfony application and I want to connect to AMQP through SSL but it says in the documentation that:我正在构建一个 PHP Symfony 应用程序,我想通过 SSL 连接到 AMQP,但它在文档中说:

If you want to use TLS/SSL encrypted AMQP, you must also provide a CA certificate.如果要使用 TLS/SSL 加密的 AMQP,还必须提供 CA 证书。 Define the certificate path in the amqp.cacert PHP.ini setting (eg amqp.cacert = /etc/ssl/certs) or in the cacert parameter of the DSN (eg amqps://localhost?cacert=/etc/ssl/certs/).在 amqp.cacert PHP.ini 设置(例如 amqp.cacert = /etc/ssl/certs)或 DSN 的 cacert 参数(例如 amqps://localhost?cacert=/etc/ssl/certs)中定义证书路径/). » ( https://symfony.com/doc/current/messenger.html#amqp-transport ) » ( https://symfony.com/doc/current/messenger.html#amqp-transport )

My issue is that I have no idea where is located the cacert file on Heroku.我的问题是我不知道 Heroku 上的 cacert 文件在哪里。

Can you help me with this please?你能帮我吗?

I've found the solution, for those who wants to know how to deal with it on Heroku: you need to download the root CA of CloudAMQP ( https://www.cloudamqp.com/docs/faq.html#how-do-i-authenticate-the-identity-of-your-server-tls-certificates ) and put it in your source code, for example in the public folder.我已经找到了解决方案,对于那些想知道如何在 Heroku 上处理它的人:你需要下载 CloudAMQP 的根 CA ( https://www.cloudamqp.com/docs/faq.html#how-do -i-authenticate-the-identity-of-your-server-tls-certificates )并将其放入您的源代码中,例如public文件夹中。

Then, just set the path in the MESSENGER_DSN env variable like this XXX?cacert=/app/public/cacertfilename.cer然后,只需像这样在 MESSENGER_DSN 环境变量中设置路径XXX?cacert=/app/public/cacertfilename.cer

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM