Skip to content

Commit 8283477

Browse files
committed
docs: list supported keys in ssl options
1 parent dc54a56 commit 8283477

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

Readme.md

+22-4
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,28 @@ it uses one of the predefined SSL profiles included. The following profiles are
268268
certificates from https://rds.amazonaws.com/doc/rds-ssl-ca-cert.pem and
269269
https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem
270270

271-
When connecting to other servers, you will need to provide an object of options, in the
272-
same format as [tls.createSecureContext](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options).
273-
Please note the arguments expect a string of the certificate, not a file name to the
274-
certificate. Here is a simple example:
271+
When connecting to other servers, you will need to provide an object with any of the
272+
following options:
273+
274+
* `ca`: The certificate(s) to trust instead of the ones Node.js is configured to trust. This refers
275+
to the value of the certificate(s) and not a filename of the certificate(s). This is passed as the
276+
`ca` option for the underlying [`tls.createSecureContext()`] call (or underlying [`crypto.createCredentials()`]
277+
if using Node.js below 0.12).
278+
* `cert`: The client certificate to use in the SSL handshake. This is passed as the `cert` option for
279+
the underlying [`tls.createSecureContext()`] call (or underlying [`crypto.createCredentials()`] if
280+
using Node.js below 0.12).
281+
* `ciphers`: The ciphers to use to use in the SSL handshake instead of the default ones for Node.js. This
282+
is passed as the `ciphers` option for [`tls.createSecureContext()`] call (or underlying [`crypto.createCredentials()`]
283+
if using Node.js below 0.12).
284+
* `key`: This is passed as the `key` option for [`tls.createSecureContext()`] call (or underlying
285+
[`crypto.createCredentials()`] if using Node.js below 0.12).
286+
* `passphrase`: This is passed as the `passphrase` option for [`tls.createSecureContext()`] call (or
287+
underlying [`crypto.createCredentials()`] if using Node.js below 0.12).
288+
289+
[`crypto.createCredentials()`]: https://nodejs.org/docs/latest-v0.10.x/api/crypto.html#crypto_crypto_createcredentials_details
290+
[`tls.createSecureContext()`]: https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options
291+
292+
Here is a simple example:
275293

276294
```js
277295
var connection = mysql.createConnection({

0 commit comments

Comments
 (0)