dakshshah96 / local-cert-generator

🚀 A set of scripts to quickly generate a HTTPS certificate for your local development environment.
968 stars 237 forks source link

Add Windows compatibility #1

Open laukstein opened 6 years ago

laukstein commented 6 years ago

README.md steps 1-2 works fine on Windows (will create rootCA.key and rootCA.pem). Step 3 is related only for OS X.

  1. Trust this certificate after importing it to your System keychain

Windows doesn't have System keychain. And step 4 fails:

> sh createSelfSigned.sh
createSelfSigned.sh: cannot make pipe for process substitution: Function not implemented
req: Option -config needs a value
req: Use -help for summary.
x509: Cannot open input file server.csr, No such file or directory
x509: Use -help for summary.
s-okubanjo commented 6 years ago

Yes please @dakshshah96 what tool can Windows users use instead

dakshshah96 commented 6 years ago

@laukstein @s-okubanjo Coming soon! I'm currently working on a Windows version of these scripts. 🎉

laukstein commented 6 years ago

@dakshshah96 perhaps https://shellcreeper.com/how-to-create-valid-ssl-in-localhost-for-xampp/ may help you 😉

binakot commented 6 years ago

And it would be nice to add a script to convert from PEM to CRT:

openssl x509 -in rootCA.pem -inform PEM -out rootCA.crt
hashimK commented 6 years ago

@laukstein follow the below steps to trust the root SSL certificates To install root SSL certificate in windows 10, use Microsoft Management Console(MMC)

Step 1: Click Start > Run Step 2: Enter MMC to open Microsoft Management Console. Step3: Go to File > Add/Remove Snap-in Step 4: Click Certificates, and select Add Step 5: Select Computer Account, and click Next Step 6: Select Local Computer and click Finish Step 7: Click OK to go back to main MMC console window. Step 8:Double-click Certificates (local computer) to expand its view. Step 9:Right-click Certificates under Trusted Root Certification Authorities and select All Tasks then Import Step 10:Complete the wizard to import the chain certificate. Browse to locate the chain certificate to be imported or rootCA.pem file to import Step 11: Select Place all certificates in the following store and select the Trusted Root Certification Authorities store.Click Next; then click Finish to complete the wizard.

Then follow the steps mentioned by @dakshshah96 unitl you reach the green highlighted part. Use this code instead of the one mentioned by @dakshshah96 "C:\Program Files\OpenSSL-Win64\bin\openssl.exe" req -new -sha256 -nodes -out server.csr -newkey rsa:2048 -keyout server.key -config server.csr.cnf Then again follow the steps mentioned by @dakshshah96 . It works this way on Windows :)

A BIG Thanks to @dakshshah96

P.S: I'm referring to this blog written by @dakshshah96 https://medium.freecodecamp.org/how-to-get-https-working-on-your-local-development-environment-in-5-minutes-7af615770eec

konstantin24121 commented 5 years ago

@hashimK Do you have trusted certificate for localhost? or browser marks it as untrusted? I tried many manuals but chrome still mark https as untrusted

newcanopies commented 3 years ago

@dakshshah96

in principle, on WSL2 running Ubuntu, would you run your package on both Windows and WSL2 layer?

thank you