mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-11 09:52:29 +01:00
18 lines
685 B
Bash
Executable File
18 lines
685 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ ! -e server.js ]
|
|
then
|
|
echo "Error: could not find main application server.js file"
|
|
echo "You should run the generate-ssl-certs.sh script from the main MEAN application root directory"
|
|
echo "i.e: bash scripts/generate-ssl-certs.sh"
|
|
exit -1
|
|
fi
|
|
|
|
echo "Generating self-signed certificates..."
|
|
mkdir -p ./config/sslcerts
|
|
openssl genrsa -out ./config/sslcerts/key.pem 4096
|
|
openssl req -new -key ./config/sslcerts/key.pem -out ./config/sslcerts/csr.pem
|
|
openssl x509 -req -days 365 -in ./config/sslcerts/csr.pem -signkey ./config/sslcerts/key.pem -out ./config/sslcerts/cert.pem
|
|
rm ./config/sslcerts/csr.pem
|
|
chmod 600 ./config/sslcerts/key.pem ./config/sslcerts/cert.pem
|