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

Connect to rethinkdb over SSL with self-signed certificate #114

Closed
matteosuppo opened this issue Jun 23, 2016 · 8 comments
Closed

Connect to rethinkdb over SSL with self-signed certificate #114

matteosuppo opened this issue Jun 23, 2016 · 8 comments
Labels
feat New feature or request.

Comments

@matteosuppo
Copy link
Contributor

Over at compose they provide rethinkdb servers with self-signed certificates.

You can connect to them in this way: https://www.compose.io/articles/rethinkdb-and-ssl-think-secure/

basically by reading a certificate

    roots := x509.NewCertPool()
    cert, err := ioutil.ReadFile("./cacert")
    roots.AppendCertsFromPEM(cert)

and connecting with the TLS

    session, err := r.Connect(r.ConnectOpts{
        Address:  "aws-eu-west-1-portal.1.dblayer.com:10605",
        Database: "test",
        AuthKey:  "QBXORIDHnnjkvUyhexl1nKcnAxbIqPBcrHeqkWglXc",
        TLSConfig: &tls.Config{
            RootCAs: roots,
        },
    })

I'm going to try to make it work. Are you interested in a Pull Request?

@aeneasr
Copy link
Member

aeneasr commented Jun 23, 2016

Yes, please use the JWK Store for storing the RootCA. Setting custom RootCAs is also quite dangerous and we should anticipate problems there. Using the JWK Store only trusted clients could update those CAs, so that's a first good step.

@aeneasr
Copy link
Member

aeneasr commented Jun 23, 2016

And I want to keep the number of configuration and env options low :)

@aeneasr aeneasr added the feat New feature or request. label Jun 23, 2016
@aeneasr
Copy link
Member

aeneasr commented Jun 23, 2016

If you need help with the JWK store let me know

@matteosuppo
Copy link
Contributor Author

Aren't JWK stored in rethinkdb?

@aeneasr
Copy link
Member

aeneasr commented Jun 23, 2016

Haha wow, I didn't think that one through. Spot on.

@aeneasr
Copy link
Member

aeneasr commented Jun 23, 2016

Ok let's make it work then like the HTTP TLS certificates (CLI option and env var)

@matteosuppo
Copy link
Contributor Author

I'm working on it

@aeneasr
Copy link
Member

aeneasr commented Jun 23, 2016

that's actually better because compromise of a priviledged client would not allow for the rootca to be changed or read

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

No branches or pull requests

2 participants