milvus-io / milvus-sdk-go

Go SDK for Milvus.
Apache License 2.0
329 stars 105 forks source link

How to connect milvus with a tls.crt? #798

Open TheZhy-x opened 1 month ago

TheZhy-x commented 1 month ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe.

Here' s my code:

  1. milvusClient, err := client.NewClient(ctx, client.Config{ Address: "xxx:443", Username: "root", Password: "Milvus", EnableTLSAuth: true, DialOptions: []grpc.DialOption{ grpc.WithTransportCredentials(creds), }, })
  2. milvusClient, err := client.NewGrpcClient( ctx, "http://root:Milvus@xxx:443", grpc.WithTransportCredentials(creds), )

There are some error I' ve met:

  1. rpc error: code = Unavailable desc = connection error: desc = "transport: authentication handshake failed: x509: certificate signed by unknown authority"
  2. rpc error: code = Unavailable desc = connection closed before server preface received

Anybody ever met this above can help me? Thanks in advance!

Describe the solution you'd like.

No response

Describe an alternate solution.

No response

Anything else? (Additional Context)

No response

congqixia commented 1 month ago

If your need to set credential certification file, https://github.com/milvus-io/milvus-sdk-go/blob/master/examples/tls/tls.go this example might provide some help

TheZhy-x commented 1 month ago

If your need to set credential certification file, https://github.com/milvus-io/milvus-sdk-go/blob/master/examples/tls/tls.go this example might provide some help

This example cannot work, either. Thank you all the same!