local-cert-generator icon indicating copy to clipboard operation
local-cert-generator copied to clipboard

Add Windows compatibility

Open laukstein opened this issue 6 years ago • 7 comments

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.

laukstein avatar Jan 30 '18 15:01 laukstein

Yes please @dakshshah96 what tool can Windows users use instead

s-okubanjo avatar Apr 26 '18 01:04 s-okubanjo

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

dakshshah96 avatar Apr 30 '18 08:04 dakshshah96

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

laukstein avatar Jul 03 '18 19:07 laukstein

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

binakot avatar Sep 12 '18 09:09 binakot

@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

hashimK avatar Oct 11 '18 06:10 hashimK

@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

konstantin24121 avatar Nov 30 '18 07:11 konstantin24121

@dakshshah96

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

thank you

newcanopies avatar Apr 09 '21 17:04 newcanopies