diff --git a/express_webpack/README.md b/express_webpack/README.md index af1932813..f0285ce40 100644 --- a/express_webpack/README.md +++ b/express_webpack/README.md @@ -13,11 +13,10 @@ ``` docker cp "$(docker-compose ps -q onesignal-web-sdk-dev)":sdk/express_webpack/certs/dev-ssl.crt . ``` - - If you're running the container in a VM, get the cert file onto the VM's host (e.g: use `scp`) - - add cert to keychain (mac OSX): - ``` - sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain dev-ssl.crt - ``` + - If you're running the container in a VM, get the cert file onto the VM's host (e.g: use `scp`) + - Add cert to system's trusted store + - macOS: `sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain dev-ssl.crt` + - Windows: `Import-Certificate -FilePath dev-ssl.crt -CertStoreLocation cert:\CurrentUser\Root` 3. Make sure the common name (e.g: localhost, texas, oregon, etc...) maps to the correct IP in your `/etc/hosts` file 4. Visit [https://localhost:4001?app_id=](https://localhost:4001?app_id=) and insert your app id as a URL query parameter @@ -127,4 +126,4 @@ If you get the error `Node Sass could not find a binding for your current enviro npm rebuild node-sass ``` -from *inside* the docker container shell. \ No newline at end of file +from *inside* the docker container shell. diff --git a/express_webpack/certs/gen-cert.sh b/express_webpack/certs/gen-cert.sh index 789b86a6d..31321500b 100755 --- a/express_webpack/certs/gen-cert.sh +++ b/express_webpack/certs/gen-cert.sh @@ -5,9 +5,10 @@ if test -f "$FILE"; then else echo "express_webpack:\n------ generating new SSL certs ------" echo "copy dev-ssl.crt from container to host with:\n> docker cp :sdk/express_webpack/certs/dev-ssl.crt ." - echo "add cert to keychain (MacOSX):\n> sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/dev-ssl.crt\n" + echo "macOS - add cert to keychain:\n> sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/dev-ssl.crt\n" + echo "Windows - add cert to cert store:\n> Import-Certificate -FilePath dev-ssl.crt -CertStoreLocation cert:\CurrentUser\Root" echo "restart browser\n--------------------------------------" - + # generate cert/key based on conf file # defaults to use Common Name: texas openssl req -config ./certs/ssl-cert-gen.conf -subj '/C=US/CN=texas' -new -x509 -newkey rsa:2048 -nodes -keyout certs/dev-ssl.key -days 365 -out certs/dev-ssl.crt