Skip to content

Commit a5f0d64

Browse files
thefourtheyejasnell
authored andcommitted
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 PR-URL: #3123 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
1 parent 317e0ec commit a5f0d64

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

doc/api/tls.markdown

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ automatically set as a listener for the [secureConnection][] event. The
162162
the `key`, `cert` and `ca` options.)
163163

164164
- `key`: A string or `Buffer` containing the private key of the server in
165-
PEM format. (Could be an array of keys). (Required)
165+
PEM format. To support multiple keys using different algorithms, an array
166+
can be provided. It can either be a plain array of keys, or an array of
167+
objects in the format `{pem: key, passphrase: passphrase}`. (Required)
166168

167169
- `passphrase`: A string of passphrase for the private key or pfx.
168170

@@ -487,7 +489,10 @@ dictionary with keys:
487489

488490
* `pfx` : A string or buffer holding the PFX or PKCS12 encoded private
489491
key, certificate and CA certificates
490-
* `key` : A string holding the PEM encoded private key
492+
* `key`: A string or `Buffer` containing the private key of the server in
493+
PEM format. To support multiple keys using different algorithms, an array
494+
can be provided. It can either be a plain array of keys, or an array of
495+
objects in the format `{pem: key, passphrase: passphrase}`. (Required)
491496
* `passphrase` : A string of passphrase for the private key or pfx
492497
* `cert` : A string holding the PEM encoded certificate
493498
* `ca` : Either a string or list of strings of PEM encoded CA

0 commit comments

Comments
 (0)