48fae94f7dec2914f77c0208d899ed0f051ebfe7
[oweals/gnunet.git] / src / gns / gnunet-gns-proxy-setup-ca
1 echo "Generating CA"
2
3 openssl req -new -x509 -days 3650 -extensions v3_ca -keyout gnscakey.pem -out gnscacert.pem -subj "/C=DE/ST=Bavaria/L=Munich/O=GNUnet Naming System/OU=GNUnet/CN=GNS Proxy CA/emailAddress=bounce@gnunet.org" -passout pass:"GNUnet Naming System"
4
5 echo "Removing passphrase from key"
6 openssl rsa -passin pass:"GNUnet Naming System" -in gnscakey.pem -out gnscakeynoenc.pem
7
8 cp gnscacert.pem $HOME/.gnunet/gns/gnscert.pem
9 cat gnscacert.pem > $HOME/.gnunet/gns/gnsCAcert.pem
10 cat gnscakeynoenc.pem >> $HOME/.gnunet/gns/gnsCAcert.pem
11
12 echo "Importing CA into browsers"
13 for f in ~/.mozilla/firefox/*.default
14 do
15   if [ -d $f ]; then
16     echo "Importing CA info firefox $f"
17     certutil -D -n "GNS Proxy CA" -d ~/.mozilla/firefox/*.default >/dev/null 2&>1
18     certutil -A -n "GNS Proxy CA" -t CT,, -d ~/.mozilla/firefox/*.default < gnscacert.pem
19   fi
20 done
21
22 if [ -d ~/.pki/nssdb ]; then
23   echo "Importing CA into chrome"
24   certutil -D -n "GNS Proxy CA" -d ~/.pki/nssdb >/dev/null 2&>1
25   certutil -A -n "GNS Proxy CA" -t CT,, -d ~/.pki/nssdb < gnscacert.pem
26 fi
27
28
29 rm gnscakey.pem gnscakeynoenc.pem gnscacert.pem
30
31 echo "You can now start gnunet-gns-proxy and configure your browser to use a SOCKS proxy on port 7777"