How to visualize remote neo4j auradb with neovis.js?

734 views Asked by At

I have a remote AuraDB, but I'm unable to visualize with neovis.js

var config = {
            container_id: "viz",
            server_url: "bolt://<server_url>:7687",
            server_user: <user>,
            server_password: <pwd>,
            initial_cypher: "match n=(:Person)-[:Knows]->(:Person) return n"
        }

The above code segment is from the neovis GitHub documentation. (https://github.com/neo4j-contrib/neovis.js/)

If I use the "bolt" protocol, the error is : Neo4jError: WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver. Please use your browsers development console to determine the root cause of the failure. Common reasons include the database being unavailable, using the wrong connection URL or temporary network problems. If you have enabled encryption, ensure your browser is configured to trust the certificate Neo4j is configured to use. WebSocket readyState is: 3

If I use the "neo4j" protocol, then : Neo4jError: Could not perform discovery. No routing servers available.

If I use the "neo4j+s" / "neo4j+ssc" protocols, then : Encryption/trust can only be configured either through URL or config, not both

I have observed neovis plugin for my webapp works well with a local neo4j db and the bolt protocol.

Please help me out with some understanding in the case of visualizing a remote neo4j aura db.

1

There are 1 answers

1
Thennan On

Aura has strict encryption policies. And the driver config used for neovis.js seems half-baked. It doesn't seem to be enough for Aura and doesn't seem to allow turning encryption off completely either.

So the best option here is to enforce encryption in the config and use an unencrypted connection Scheme.

Working config for Aura by using an unencrypted connection URI and enforcing encryption in the config

var config = {
    encrypted:"ENCRYPTION_ON",
    trust: "TRUST_SYSTEM_CA_SIGNED_CERTIFICATES",
    container_id: "viz",
    server_url: "neo4j://<dbid>.databases.neo4j.io",
    ...

Updated Solution for Neovis 2.0.2, from this GitHub issue

        var config = {
            containerId: "viz",
            neo4j: {
                serverUrl: "neo4j://<dbid>.databases.neo4j.io",
                serverUser: "neo4j",
                serverPassword: "secret",
                driverConfig: { 
                    encrypted: "ENCRYPTION_ON",
                    trust: "TRUST_SYSTEM_CA_SIGNED_CERTIFICATES"
                    }   
            },