I have a module that manages Azure Cosmosdb Gremlin queries. When I call it from jupyter notebooks like this, it works fine. However, when calling it from the Django app I get a ConnectionError:
Cannot connect to host graph-exodestiny.gremlin.cosmos.azure.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')]
Both the local jupyter notebook and the django app are importing the same module. That module's code is pretty simple gremlinpython stuff:
## Managing the client
def open_client(self):
self.c = client.Client(
self.endpoint,
"g",
username=self.username,
password=self.password,
message_serializer=serializer.GraphSONSerializersV2d0(),
)
def close_client(self):
self.c.close()
## Managing the queries
def run_query(self, query="g.V().count()"):
self.open_client()
callback = self.c.submitAsync(query)
res = callback.result().all().result()
self.close_client()
self.res = res
- Both are importing the same
cmdb_graph.py
connector module here. - Both are running on the same local environment.
I also have the same application running here on an Azure Web App and it's working fine. From this environment.
The closest related issue is this one, however I'm unable to draw a connection. They seem to be totally different connector types.