0

I'm new to the OpenSSL and Node community and could use some help on some commands.

I'm working on a node application where users can input their information and get a browser certificate to hit an application I have on my server. I want the user to be able to put in their information once, then have a browser cert download (in other words, all the commands need to run with no more user input).

I have the three commands using child processes in Node and OpenSSL and I'm trying to translate them over to node, but I'm having some issues.

My first command get variables from the users runs fine:

sudo openssl req -new -nodes -out /etc/pki/tls/request/bdd-req.pem -keyout /etc/pki/tls/private/bdd-key.pem -subj "/C='+country+'/ST='+state+'/L='+locality+'/O='+organization+'/CN='+name+'" -passout pass:'+password+' -x509 -days 365 -config /etc/pki/tls/openssl.cnf

However when the second command runs, I get an error:

sudo openssl ca -out /etc/pki/tls/cert-pem/bdd-cert.pem -days 365 -config /etc/pki/tls/openssl.cnf -passin pass:*PASSWORD* -keyfile /etc/pki/tls/private/cakey.pem -cert /etc/pki/tls/cacert.pem -selfsign -infiles /etc/pki/tls/request/bdd-req.pem


Error: Command failed: Using configuration from /etc/pki/tls/openssl.cnf
Error reading certificate request in /etc/pki/tls/mapedit-req-pem/bdd-req.pem
140052424636320:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: CERTIFICATE REQUEST

at ChildProcess.exithandler (child_process.js:658:15)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)

What is the CERTIFICATE REQUEST it's asking for? Isn't that the cert flag?

BDD
  • 665
  • 17
  • 31
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Information Security Stack Exchange](http://security.stackexchange.com/) would be a better place to ask. Also [Where do I post questions about Dev Ops?](http://meta.stackexchange.com/q/134306). – jww Jun 06 '16 at 19:52
  • Sorry, but I don't understand how this isn't a development question. I'm asking a question [similar to this one](http://stackoverflow.com/questions/10175812/how-to-create-a-self-signed-certificate-with-openssl) about how to work with OpenSSL in Node. Am I missing something? – BDD Jun 06 '16 at 19:58
  • 1
    The controlling or dominating part of the question is how to use the `openssl ca` subcommand (unless I am missing something, which could well be the case). You are right about the cited question - its off-topic too. Unfortunately, Stack overflow does a rather poor job at policing itself. – jww Jun 06 '16 at 20:36

0 Answers0