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