wey-gu / jupyter_nebulagraph

NebulaGraph Queries and visualization in Jupyter notebook.(previously known as ipython-ngql)
https://jupyter-nebulagraph.readthedocs.io/en/stable/
Other
28 stars 3 forks source link

feat: add tls support #44

Closed wey-gu closed 3 months ago

wey-gu commented 3 months ago

thrift TLS over TCP

wey-gu commented 3 months ago
# get pub IP and add to white list
!curl ifconfig.me

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-xxxx.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;")
wey-gu commented 3 months ago

done with #45