2

I am using openssl-wrapper, a nodejs package. It is easy to customize parameters! But i got an error, i can not make the code works properly.

The implemented code:

Q.fcall(function caKey() {
  var params = {
    des3: true,
    passout: 'pass:1234567890',
    out: key,
    '1024': false
  };
  console.log("caKey", dataFolder, params);
  return openssl.qExec('genrsa', params);
}).then(function debugOutput(data) {
    // onFullfill
    console.log("done", data);
  })
  .catch(function (err) {
    // get err
    console.error(err);
  });

I got this error:

caKey D:/certs-dev { '1024': false,
  des3: true,
  passout: 'pass:1234567890',
  out: 'D:/certs-dev/ca/ca.key' }
Wed, 27 Apr 2016 11:40:24 GMT openssl-wrapper > openssl genrsa -des3 -passout pass:1234567890 -out D:/certs-dev/ca/ca.key 1024
15316:error:02001000:system library:fopen:system library:bss_file.c:175:fopen('','rb')
15316:error:2006D002:BIO routines:BIO_new_file:system lib:bss_file.c:180:
15316:error:0E078002:configuration file routines:DEF_LOAD:system lib:conf_def.c:197:

What am i missing ? How can i make it works ?

Please help me. Thank you very much !

2
  • 1
    Just guessing, but the issue is OpenSSL configuration file cannot be located. You will have to do something like set OPENSSL_CONF=c:\OpenSSL-Win32\bin\openssl.cfg. Try searching for OPENSSL configuration file windows to see similar issues Commented Apr 27, 2016 at 20:45
  • Thank you, it worked for me! In NodeJS, I set a variable process.env.OPENSSL_CONF = "c:\OpenSSL-Win32\bin\openssl.cfg" before call the function. It also works well. Commented Apr 28, 2016 at 2:41

1 Answer 1

1

Thanks to @jww

Follow his guide, the error is resolved by configuring the environment variable:

set OPENSSL_CONF=c:\OpenSSL-Win32\bin\openssl.cfg

Or set the environment variable in NodeJS application, before call the function.

process.env.OPENSSL_CONF = "c:\OpenSSL-Win32\bin\openssl.cfg"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.