openssl-nodejs icon indicating copy to clipboard operation
openssl-nodejs copied to clipboard

"-in" used in a parameter throws an error

Open SirFrancisDrake93 opened this issue 5 years ago • 2 comments

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'

SirFrancisDrake93 avatar Oct 22 '20 14:10 SirFrancisDrake93

experiencing this same error. Can you commit the fix?

fhirfly avatar Mar 22 '21 18:03 fhirfly

@codevibess, Can you commit this fix?

ksw25 avatar Feb 08 '22 19:02 ksw25