-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_self_signed_keys.sh
executable file
·26 lines (26 loc) · 1.22 KB
/
generate_self_signed_keys.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
if [ -e "keys" ]
then
echo "keys dir already exists, please delete before re-runninig this script"
exit -1
fi
mkdir keys
openssl genrsa -des3 -passout pass:x -out keys/server.pass.key 2048
openssl rsa -passin pass:x -in keys/server.pass.key -out keys/server.key
rm keys/server.pass.key
openssl req -new -key keys/server.key -out keys/server.csr
openssl x509 -req -days 365 -in keys/server.csr -signkey keys/server.key -out keys/server.crt
cargo build --release
cargo build
ln -s "$(pwd)/keys" "$(pwd)/target/release/"
ln -s "$(pwd)/keys" "$(pwd)/target/debug/"
echo "\n\n\n"
echo "On linux, to support self signed cert in chrome and postman, you must import the cert to chrome"
echo "in chrome, go to \"chrome://settings/certificates \""
echo "Click Manage Certificates, on the authorities tab, check for an existing folder/cert for"
echo "localhost delete if it already exists, then click import, navigate to server.crt, and import"
echo "Check box for trust this cert for websites"
echo "close every single chrome process and children like hangouts, signal, then restart"
echo "navigate to https site using localhost if that is what you used for CN=, be sure postman uses"
echo "localhost and not 127.0.0.1"
echo "that is all! :)"