vesoft-inc / nebula-python

Client API of Nebula Graph in Python
194 stars 78 forks source link

feat: should support when none ca being provided for TLS #331

Closed wey-gu closed 7 months ago

wey-gu commented 7 months ago

as titled.

wey-gu commented 7 months ago

confirmed it's already supported:

from nebula3.Config import Config, SSL_config
from nebula3.Exception import IOErrorException
from nebula3.gclient.net import ConnectionPool

# set SSL config
ssl_config = SSL_config()

host = "nebula-graph-xxx.aws.dev.cloud.nebula-graph.io"
port = 9669

pool = ConnectionPool()

addresses = [(host, port)]
config = Config()

pool.init(addresses, config, ssl_config)

session = pool.get_session("dbaas-test@vesoft.com", "xxxx")

session.execute("SHOW SPACES;")

But maybe we could consider support when ssl_config is omitted, it should check it's over TLS/SSL and go with default ssl_config().