Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ client is:
||timeout||How long the client should let operations live for before timing out. Default is Infinity.||
||connectTimeout||How long the client should wait before timing out on TCP connections. Default is up to the OS.||
||maxConnections||Whether or not to enable connection pooling, and if so, how many to maintain.||
||tlsOptions||Additional [options](http://nodejs.org/api/tls.html#tls_tls_connect_port_host_options_callback) passed to the TLS connection layer when connecting via `ldaps://`||

If using connection pooling, you can additionally pass in:

Expand Down
3 changes: 2 additions & 1 deletion lib/client/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ function Client(options) {
this.log = options.log.child({clazz: 'Client'}, true);
this.port = _url ? _url.port : false;
this.secure = _url ? _url.secure : false;
this.tlsOptions = options.tlsOptions;
this.socketPath = options.socketPath || false;
this.timeout = parseInt((options.timeout || 0), 10);
this.url = _url;
Expand Down Expand Up @@ -721,7 +722,7 @@ Client.prototype._connect = function _connect() {
self.emit('connect', socket);
}

socket = proto.connect((this.port || this.socketPath), this.host);
socket = proto.connect((this.port || this.socketPath), this.host, this.secure ? this.tlsOptions : null);

socket.once('connect', onConnect);
socket.once('secureConnect', onConnect);
Expand Down
3 changes: 2 additions & 1 deletion lib/client/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ function ClientPool(options) {
log: options.log,
socketPath: options.socketPath,
timeout: (options.timeout || 0),
url: options.url
url: options.url,
tlsOptions: options.tlsOptions
};
this.pool = createPool(options);
}
Expand Down