3

我正在 go micro 中创建一个 Web 服务...

service := web.NewService(
            web.Name(""),
            web.Address(""),
            web.Advertise(""),
            web.RegisterTTL(time.Second*30),
               web.Registry(reg),
        )

其中 reg := registry.NewRegistry(registryOptions)

func registryOptions(ops *registry.Options) {
    ops.Timeout = time.Second * 30
    ops.Secure = true
    ops.TLSConfig = &tls.Config{InsecureSkipVerify: true}
}

我正在使用 --registery=consul 启动服务

服务在 docker 容器内运行..虽然服务向领事注册,但我仍然遇到问题..

consul.watch: Watch (type: services) errored: Unexpected response code: 400 (Client sent an HTTP request to an HTTPS server

Consul 是为 TLS 配置设置的。

4

0 回答 0