Skip to content

Javascript Driver TLS options not accurate in document #9

@kkpoon

Description

@kkpoon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions