【发布时间】:2021-06-29 13:33:20
【问题描述】:
我在我的 Windows 机器上的 Docker 容器中使用 Mercure Hub。我有一个 Symfony 应用程序,我想使用 Mercure 包向客户端推送消息。
/**
* @Route("/message", name="sendMessage", methods={"POST"})
*/
public function __invoke(PublisherInterface $publisher, Request $request): RedirectResponse
{
$update = new Update('https://chat.afsy.fr/message', json_encode([
'message' => $request->request->get('message'),
]));
$publisher($update);
return $this->redirectToRoute('home');
}
当我在客户端 javascript 中获取此端点时(即发布要由集线器推送的消息),我从 PublisherInterface 内的 HTTPClient 得到了这个异常:
传输异常
fopen():SSL 操作失败,代码为 1。OpenSSL 错误消息: 错误:1416F086:SSL 例程:tls_process_server_certificate:证书 验证失败
当我使用 Mercure 调试工具发布消息时,一切正常,但正如我们所见,我的 Symfony 应用程序却不行。我想知道为什么? :)
【问题讨论】: