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

Javascript Driver TLS options not accurate in document #9

Open
kkpoon opened this issue Jun 13, 2017 · 0 comments
Open

Javascript Driver TLS options not accurate in document #9

kkpoon opened this issue Jun 13, 2017 · 0 comments

Comments

@kkpoon
Copy link

kkpoon commented Jun 13, 2017

In the document, https://www.rethinkdb.com/api/javascript/connect/

ssl: a hash of options to support SSL connections (default null). Currently, there is only one option available, and if the ssl option is specified, this key is required:

  • ca: a list of Node.js Buffer objects containing SSL CA certificates.

But, according to the source code
https://github.com/rethinkdb/rethinkdb/blob/v2.3.3/drivers/javascript/net.coffee#L160-L171

        # Configuration options for enabling an SSL connection
        # Allows the ability to pass in all the options as specified in
        # [tls.connect](https://nodejs.org/api/tls.html#tls_tls_connect_options_callback)
        # or just true  in case the client wants ssl but the server
        # is using a certificate with a valid verified chain and there
        # is no need to specify certificates on the client
        if typeof host.ssl is 'boolean' && host.ssl
            @ssl = {}
        else if typeof host.ssl is 'object'
            @ssl = host.ssl
        else
            @ssl = false

and

https://github.com/rethinkdb/rethinkdb/blob/v2.3.3/drivers/javascript/net.coffee#L952-L957

        if @ssl
          @ssl.host = @host
          @ssl.port = @port
          @rawSocket = tls.connect @ssl
        else
          @rawSocket = net.connect @port, @host

it allows all NodeJS TLS connection options to pass in.

@gabor-boros gabor-boros transferred this issue from rethinkdb/rethinkdb May 3, 2022
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

1 participant