From 2d058c4d1bc639dd96ab7ce5b2dd6efffa95f4e0 Mon Sep 17 00:00:00 2001 From: Sakthipriyan Vairamani Date: Wed, 30 Sep 2015 08:03:43 +0530 Subject: [PATCH 1/3] doc: createServer's key option can be an array The `tls` module's `createServer` and `createSecureContext` accept `key` option and it can be an array of keys as well. This patch explains the format of the entries in that array. Corresponding code: https://github.com/nodejs/node/blob/v4.1.1/lib/_tls_common.js#L73-L90 --- doc/api/tls.markdown | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/api/tls.markdown b/doc/api/tls.markdown index 93779e54bc2d2a..068846162bc645 100644 --- a/doc/api/tls.markdown +++ b/doc/api/tls.markdown @@ -162,7 +162,10 @@ automatically set as a listener for the [secureConnection][] event. The the `key`, `cert` and `ca` options.) - `key`: A string or `Buffer` containing the private key of the server in - PEM format. (Could be an array of keys). (Required) + PEM format. It can also be an array of keys. The array can either be of + just keys or if you have different passphrases for the keys, then the + array elements can be of the form `{pem: key, passphrase: passphrase}`. + (Required) - `passphrase`: A string of passphrase for the private key or pfx. @@ -486,7 +489,11 @@ dictionary with keys: * `pfx` : A string or buffer holding the PFX or PKCS12 encoded private key, certificate and CA certificates -* `key` : A string holding the PEM encoded private key +* `key`: A string or `Buffer` containing the private key of the server in + PEM format. It can also be an array of keys. The array can either be of + just keys or if you have different passphrases for the keys, then the + array elements can be of the form `{pem: key, passphrase: passphrase}`. + (Required) * `passphrase` : A string of passphrase for the private key or pfx * `cert` : A string holding the PEM encoded certificate * `ca` : Either a string or list of strings of PEM encoded CA From 226ee11e2d067154a6e06e92d983e3a21c9c6d58 Mon Sep 17 00:00:00 2001 From: Sakthipriyan Vairamani Date: Wed, 30 Sep 2015 08:22:37 +0530 Subject: [PATCH 2/3] Mention different algorithms --- doc/api/tls.markdown | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/api/tls.markdown b/doc/api/tls.markdown index 068846162bc645..8c1601d348a725 100644 --- a/doc/api/tls.markdown +++ b/doc/api/tls.markdown @@ -164,8 +164,8 @@ automatically set as a listener for the [secureConnection][] event. The - `key`: A string or `Buffer` containing the private key of the server in PEM format. It can also be an array of keys. The array can either be of just keys or if you have different passphrases for the keys, then the - array elements can be of the form `{pem: key, passphrase: passphrase}`. - (Required) + array elements can be of the form `{pem: key, passphrase: passphrase}` and + the keys should use different algorithms. (Required) - `passphrase`: A string of passphrase for the private key or pfx. @@ -490,10 +490,10 @@ dictionary with keys: * `pfx` : A string or buffer holding the PFX or PKCS12 encoded private key, certificate and CA certificates * `key`: A string or `Buffer` containing the private key of the server in - PEM format. It can also be an array of keys. The array can either be of - just keys or if you have different passphrases for the keys, then the - array elements can be of the form `{pem: key, passphrase: passphrase}`. - (Required) + PEM format. It can also be an array of keys. The array can either be of + just keys or if you have different passphrases for the keys, then the + array elements can be of the form `{pem: key, passphrase: passphrase}` and + the keys should use different algorithms. (Required) * `passphrase` : A string of passphrase for the private key or pfx * `cert` : A string holding the PEM encoded certificate * `ca` : Either a string or list of strings of PEM encoded CA From 733146de6a736a6a66edb6d78fec0a76d1f8ea50 Mon Sep 17 00:00:00 2001 From: Sakthipriyan Vairamani Date: Mon, 26 Oct 2015 00:19:48 +0530 Subject: [PATCH 3/3] fixed sentence as per silverwind's suggestion --- doc/api/tls.markdown | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/doc/api/tls.markdown b/doc/api/tls.markdown index 8c1601d348a725..9f72c34ce87d8b 100644 --- a/doc/api/tls.markdown +++ b/doc/api/tls.markdown @@ -162,10 +162,9 @@ automatically set as a listener for the [secureConnection][] event. The the `key`, `cert` and `ca` options.) - `key`: A string or `Buffer` containing the private key of the server in - PEM format. It can also be an array of keys. The array can either be of - just keys or if you have different passphrases for the keys, then the - array elements can be of the form `{pem: key, passphrase: passphrase}` and - the keys should use different algorithms. (Required) + PEM format. To support multiple keys using different algorithms, an array + can be provided. It can either be a plain array of keys, or an array of + objects in the form of `{pem: key, passphrase: passphrase}`. (Required) - `passphrase`: A string of passphrase for the private key or pfx. @@ -490,10 +489,9 @@ dictionary with keys: * `pfx` : A string or buffer holding the PFX or PKCS12 encoded private key, certificate and CA certificates * `key`: A string or `Buffer` containing the private key of the server in - PEM format. It can also be an array of keys. The array can either be of - just keys or if you have different passphrases for the keys, then the - array elements can be of the form `{pem: key, passphrase: passphrase}` and - the keys should use different algorithms. (Required) + PEM format. To support multiple keys using different algorithms, an array + can be provided. It can either be a plain array of keys, or an array of + objects in the form of `{pem: key, passphrase: passphrase}`. (Required) * `passphrase` : A string of passphrase for the private key or pfx * `cert` : A string holding the PEM encoded certificate * `ca` : Either a string or list of strings of PEM encoded CA