openssl-nodejs
openssl-nodejs copied to clipboard
"-in" used in a parameter throws an error
I tried to use the -subj parameter and used "test-intern" as Common Name. The module interprets the "-in" as new parameter and not as string.
Example throwing an error:
global.openssl(['req', '-config', {name: "csr.conf", buffer: csrConfigBuffer}, '-new', '-key', {name: "private.pem", buffer: privateKeyBuffer}, "-subj", "/C=Test/ST=Test/L=Test/O=Test/OU=Test/CN=test-intern"], function(errorOutput, bufferOuptut) {
Resolved by changing:
const checkCommandForIO = element => element.includes('-in') || element.includes('-out')
|| element.includes('-keyout') || element.includes('-signkey') || element.includes('-key')
to:
const checkCommandForIO = element => element == '-in' || element == '-out'
|| element == '-keyout' || element == '-signkey' || element == '-key' || element == '-config'
experiencing this same error. Can you commit the fix?
@codevibess, Can you commit this fix?