为什么我在连接到本地 EventStoreDB 时会收到“收到损坏的消息”?

问题描述

我正在使用 Rust 开发 CQRS DDD 模式中的微服务,并且我使用 Eventstoredb 作为命令服务。但是当grpc想要连接Eventstore docker时,出现这个错误

ERROR eventstore::grpc] Error when connecting to https://localhost:2113/: transport error: error trying to connect: received corrupt message

搜索了很多,但没有答案。

解决方法

现在我找到了解决方案。连接字符串的默认值为 TLS=true,您必须在 localhost 的连接字符串中手动写入 TLS=false。

 let settings = "esdb://admin:changeit@localhost:2113?tls=false".parse()?;