Skip to content

Commit

Permalink
Merge pull request #45 from wey-gu/nebula_cloud
Browse files Browse the repository at this point in the history
feat: support TLS
  • Loading branch information
wey-gu authored Apr 8, 2024
2 parents 93769dd + 7af3e8c commit 8848227
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/get_started_docs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,7 @@
"outputs": [],
"source": [
"##uncomment to draw\n",
"#%ng_draw"
"# %ng_draw"
]
},
{
Expand Down
17 changes: 14 additions & 3 deletions ngql/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from nebula3.data.DataObject import Node, Relationship, PathWrapper
from nebula3.gclient.net import ConnectionPool as NebulaConnectionPool
from nebula3.Config import Config as NebulaConfig
from nebula3.Config import SSL_config


rel_query_sample_edge = Template(
Expand Down Expand Up @@ -164,9 +165,19 @@ def _init_connection_pool(self, args):
config.max_connection_pool_size = self.max_connection_pool_size

self.credential = args.user, args.password
connect_init_result = connection_pool.init(
[(args.address, args.port)], config
)
try:
connect_init_result = connection_pool.init(
[(args.address, args.port)], config
)
except RuntimeError:
# When GraphD is over TLS
print(
"Got RuntimeError, trying to connect assuming GraphD is over TLS"
)
ssl_config = SSL_config()
connect_init_result = connection_pool.init(
[(args.address, args.port)], config, ssl_config
)
if not connect_init_result:
return CONNECTION_POOL_INIT_FAILURE
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="jupyter_nebulagraph",
version="0.10.1",
version="0.11.0",
author="Wey Gu",
author_email="[email protected]",
description="Jupyter extension for NebulaGraph",
Expand Down
2 changes: 1 addition & 1 deletion setup_ipython.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="ipython-ngql",
version="0.10.1",
version="0.11.0",
author="Wey Gu",
author_email="[email protected]",
description="Jupyter extension for NebulaGraph",
Expand Down

0 comments on commit 8848227

Please sign in to comment.