Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dev Env] Add Windows cert install instructions #1173

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions express_webpack/README.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading