1

I followed the steps installing openSSL after I have problem in generating the certificate.

https://tecadmin.net/install-openssl-on-windows/

Unfortunately, the site didn't allow me to submit my problem. The cursor wouldn't go to the name and email which are the required textbox to fill up.

I hope someone can advise me what have I been missing in order to generate the certificate.

Here's my attempt :

C:\Program Files\OpenSSL-Win64>version
'version' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\OpenSSL-Win64>openssl req -x509 -out localhost.crt -keyout localhost.key \
req: Use -help for summary.

C:\Program Files\OpenSSL-Win64>  -newkey rsa:2048 -nodes -sha256 \
'-newkey' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\OpenSSL-Win64>  -subj '/CN=localhost' -extensions EXT -config <( \
The system cannot find the file specified.

C:\Program Files\OpenSSL-Win64>   printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")

Even going into the bin area where openSSL.exe reside, it is no good still

C:\Program Files\OpenSSL-Win64\bin>openssl req -x509 -out localhost.crt -keyout localhost.key \
req: Use -help for summary.

C:\Program Files\OpenSSL-Win64\bin>  -newkey rsa:2048 -nodes -sha256 \
'-newkey' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\OpenSSL-Win64\bin>  -subj '/CN=localhost' -extensions EXT -config <( \
The system cannot find the file specified.

C:\Program Files\OpenSSL-Win64\bin>   printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
  • You’re trying to use Bash syntax in Command Prompt. This is never going to work. – Daniel B Dec 1 '19 at 12:05
2

I hope someone can advise me what have I been missing in order to generate the certificate.

You attempted to run OpenSSL prompt commands within a Command Prompt. You need to run OpenSSL within a Command Prompt in order to start the required OpenSSL prompt.

This required step was clearly indicated in the tutorial you linked to.

Open a command prompt and type openssl to get OpenSSL prompt. Then run version command on OpenSSL proper to view installed OpenSSL version.

enter image description here

Source: How To Install OpenSSL on Windows

Based on the information provided in the question body, and the fact you are getting 'version' is not recognized as an internal or external command, operable program or batch file.` it means you are not launching OpenSSL. I have provided a screenshot that explains what you should be doing exactly.

enter image description here

Even going into the bin area where openSSL.exe reside, it is no good still C:\Program Files\OpenSSL-Win64\bin>openssl req -x509 -out localhost.crt -keyout localhost.key \ req: Use -help for summary.

You need to run OpenSSL.exe before you run this command.

enter image description here

Issue the command exactly as it appears in the above screenshot. If you did not choose to include the OpenSSL \bin directory then you should reinstall OpenSSL.

In order for this OpenSSL command to work, -subj '/CN=localhost' -extensions EXT -config, you must have defiend the OPENSSL_CONF PATH system variable. There is a way to avoid creating the system variable but that isn't within the scope of this answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.