Skip to content

Commit

Permalink
Merge pull request #1173 from OneSignal/dev/docs_windows_certs
Browse files Browse the repository at this point in the history
[Dev Env] Add Windows cert install instructions
  • Loading branch information
jkasten2 committed Apr 30, 2024
2 parents 5c4c81e + 15bc160 commit 749b04a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
11 changes: 5 additions & 6 deletions express_webpack/README.md
Expand Up @@ -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

Expand Down Expand Up @@ -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.
from *inside* the docker container shell.
5 changes: 3 additions & 2 deletions express_webpack/certs/gen-cert.sh
Expand Up @@ -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 <containerId>: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
Expand Down

0 comments on commit 749b04a

Please sign in to comment.