Skip to content

Commit

Permalink
tls: tweak clientCertEngine argument parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Jun 2, 2021
1 parent def5758 commit 954ea8c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/internal/tls.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,15 @@ function configSecureContext(context, options = {}, name = 'options') {
}
}

if (clientCertEngine !== undefined) {
if (typeof clientCertEngine === 'string') {
if (typeof context.setClientCertEngine !== 'function')
throw new ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED();
if (typeof clientCertEngine !== 'string') {
throw new ERR_INVALID_ARG_TYPE(`${name}.clientCertEngine`,
else
context.setClientCertEngine(clientCertEngine);
} else if (clientCertEngine !== undefined) {
throw new ERR_INVALID_ARG_TYPE(`${name}.clientCertEngine`,
['string', 'null', 'undefined'],
clientCertEngine);
}
context.setClientCertEngine(clientCertEngine);
}

if (ticketKeys !== undefined) {
Expand Down

0 comments on commit 954ea8c

Please sign in to comment.