跳到主要内容

tls

需要在 gen.sh 文件中配置 CommonNameCommonName 是指客户端在连接时应该指定的服务器名称。

gen.sh
#!/usr/bin/env sh
# your variables

其他 TLS 配置

要完成 TLS 设置,您还需要配置服务器证书和客户端身份验证。

服务器配置

配置您的 Milvus 服务器以使用 TLS 证书:

tls:
serverPemPath: /path/to/server.pem
serverKeyPath: /path/to/server.key
caPemPath: /path/to/ca.pem
客户端配置

配置您的客户端以使用 TLS 连接:

from pymilvus import connections

connections.connect(
host="localhost",
port="19530",
secure=True,
client_pem_path="/path/to/client.pem",
client_key_path="/path/to/client.key",
ca_pem_path="/path/to/ca.pem",
server_name="localhost"
)