Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple PFX in tls.createSecureContext #14756

Closed
djphoenix opened this issue Aug 11, 2017 · 0 comments
Closed

Support for multiple PFX in tls.createSecureContext #14756

djphoenix opened this issue Aug 11, 2017 · 0 comments
Labels
feature request Issues that request new features to be added to Node.js. tls Issues and PRs related to the tls subsystem.

Comments

@djphoenix
Copy link
Contributor

Feature request

As per as tls.createSecureContext accepts multiple key/cert-chain options, I think there is a good approach to get also multiple PFX support. E.g. one for RSA and another one for ECDSA.

Workarounds

  1. Use key/cert arrays:
const config = {
  key: [ keys.dsa.key, keys.rsa.key ],
  cert: [
    Buffer.concat([keys.dsa.cert, ...keys.dsa.chain]),
    Buffer.concat([keys.rsa.cert, ...keys.rsa.chain])
  ],
  ...
}

const context = tls.createSecureContext(config)
  1. Manually call context.loadPKCS12 for another chain:
const config = {
  pfx: keys.rsa.pfx,
  ...
}

const context = tls.createSecureContext(config)
context.context.loadPKCS12(keys.dsa.pfx)

New API proposal

const config = {
  pfx: [keys.rsa.pfx, keys.dsa.pfx],
  ...
}

// Or for encrypted PFX, like for keys:
const config = {
  pfx: [
    { buffer: keys.rsa.pfx, passphrase: 'pA$sW0rD' },
    { buffer: keys.dsa.pfx, passphrase: 'h4cKm3iFy0uCaN' }
  ],
  ...
}

const context = tls.createSecureContext(config)
@mscdex mscdex added feature request Issues that request new features to be added to Node.js. tls Issues and PRs related to the tls subsystem. labels Aug 11, 2017
djphoenix added a commit to djphoenix/node that referenced this issue Sep 1, 2017
Add support for multiple PFX files in tls.createSecureContext.
Also added support for object-style PFX pass.

Fixes: nodejs#14756
MylesBorins pushed a commit that referenced this issue Sep 10, 2017
Add support for multiple PFX files in tls.createSecureContext.
Also added support for object-style PFX pass.

PR-URL: #14793
Fixes: #14756
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this issue Sep 11, 2017
Add support for multiple PFX files in tls.createSecureContext.
Also added support for object-style PFX pass.

PR-URL: #14793
Fixes: #14756
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this issue Sep 11, 2017
Add support for multiple PFX files in tls.createSecureContext.
Also added support for object-style PFX pass.

PR-URL: #14793
Fixes: #14756
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this issue Sep 12, 2017
Add support for multiple PFX files in tls.createSecureContext.
Also added support for object-style PFX pass.

PR-URL: #14793
Fixes: #14756
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax pushed a commit to addaleax/node that referenced this issue Sep 13, 2017
Add support for multiple PFX files in tls.createSecureContext.
Also added support for object-style PFX pass.

PR-URL: nodejs#14793
Fixes: nodejs#14756
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. tls Issues and PRs related to the tls subsystem.
Projects
None yet
Development

No branches or pull requests

2 participants