0

我正在尝试使用集线器接口进行发布,但每次我收到此错误

SSL connect error for "https://localhost:8000/.well-known/mercure" 

我正在使用 Symfony 本地 Web 服务器运行 mercure,所以 mercure 它在 https://localhost:8000/.well-known/mercure 上运行。我已经检查过了,它正在运行,但我无法发布。我正在从 Vue 调用的控制器进行此调用。

$update = new Update(
    [
        sprintf("/conversaciones/%s", $conversacion->getId()),
        sprintf("/conversaciones/%s", $recipiente->getUsuario()->getNombre()),
    ],
    $mensajeSerializado,
    true
);
$this->hubInterfacePublisher->publish($update);

Stackoverflow 对其他问题的一些评论提到了这一点: Mercure with symfony not working with vue

Mecure 不支持自签名证书,您必须在 http_client.default_configuration 下的 config/dev/framework.yaml 中添加 verify_peer: false

试过了,但对我不起作用。另外,对于我所阅读的内容,不建议将其设置为 false HTTP Certificates

我还尝试在我的 .env 上将 https 更改为 http,但我得到了 401 Unauthorized。

我检查了 symfonycast 教程,他们在 localhost:8000 上有 .env 环境,所以我认为不可能,但我不知道我还能尝试什么。

据我所知,这与 CORS 有关。但不知道如何解决。

任何帮助表示赞赏,
谢谢:)

4

0 回答 0