Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when connecting to ArangoDB with SSL enabled #95

Closed
anthonybriand opened this issue Feb 14, 2018 · 4 comments
Closed

Error when connecting to ArangoDB with SSL enabled #95

anthonybriand opened this issue Feb 14, 2018 · 4 comments

Comments

@anthonybriand
Copy link

anthonybriand commented Feb 14, 2018

ArangoDB : 3.3.3
go-driver : 27122ab
Platform : Mac OSX 10.13.3 / Debian 8.10 Jessie x86_64

I have a simple arangodb cluster started with arangodb-starter (docker).

I have enabled the --auth.jwt-secret option and the --ssl.auto-key option.

All is working fine via the WebUI but via the go-driver I encounter some problems (I am using the VST protocol):
Client and Connection seems to be valid no error returned but when I use the Database function of the client it throw these errors :

With Basic authentication

panic: expected type 'Array', got 'None'
readChunkLoop error: &net.OpError{Op:"read", Net:"tcp", Source:(*net.TCPAddr)(0xc420190060), Addr:(*net.TCPAddr)(0xc420190090), Err:(*os.SyscallError)(0xc4201ae000)}

With JWT authentication

readChunkLoop error: &net.OpError{Op:"read", Net:"tcp", Source:(*net.TCPAddr)(0xc420011d10), Addr:(*net.TCPAddr)(0xc420011d40), Err:(*os.SyscallError)(0xc42014c000)}
readChunkLoop error: &net.OpError{Op:"read", Net:"tcp", Source:(*net.TCPAddr)(0xc420160060), Addr:(*net.TCPAddr)(0xc420160090), Err:(*os.SyscallError)(0xc420176000)}
readChunkLoop error: &net.OpError{Op:"read", Net:"tcp", Source:(*net.TCPAddr)(0xc420194060), Addr:(*net.TCPAddr)(0xc420194090), Err:(*os.SyscallError)(0xc4200e1260)}
panic: context deadline exceeded

If I disable the ssl option all is working fine

@anthonybriand anthonybriand changed the title Error when connecting to ArangoDB with JWT and SSL enabled Error when connecting to ArangoDB with SSL enabled Feb 14, 2018
@ewoutp
Copy link
Contributor

ewoutp commented Feb 14, 2018

@anthonybriand Please add your code used to create the VST connection.

@anthonybriand
Copy link
Author

anthonybriand commented Feb 14, 2018

There is the code :

    connection, e := vst.NewConnection(vst.ConnectionConfig{
        Endpoints: config.Current.DatabaseConfig.Endpoints,
        ConnectionConfig: cluster.ConnectionConfig{
            DefaultTimeout: 60 * time.Second,
        },
    })

    if e != nil {
        panic(e)
    }

    client, e := driver.NewClient(driver.ClientConfig{
        Connection:     connection,
        Authentication: driver.JWTAuthentication(config.Current.DatabaseConfig.Username, config.Current.DatabaseConfig.Password),
    })

    if e != nil {
        panic(e)
    }

    database, e := client.Database(nil, "my_database") // <-- Throw the error

    if e != nil {
        panic(e)
    }

Endpoints are (I have tested with vst+ssl too) :

      "vst://192.168.64.3:8529",
      "vst://192.168.64.3:8534",
      "vst://192.168.64.3:8539"

@ewoutp
Copy link
Contributor

ewoutp commented Feb 14, 2018

Ok, the TLSConfig field is missing for vst.ConnectionConfig.
This has to be set for SSL connections.

@anthonybriand
Copy link
Author

That's it sorry I have misreaded the README, thank you for you help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants