From 384c28a7b0eb7ade7bd93663e35375f5fd16a0c3 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Tue, 12 Jun 2012 11:17:11 +0000 Subject: [PATCH] autoimport CA --- src/gns/Makefile.am | 2 ++ src/gns/gnunet-gns-proxy-setup-ca | 22 ++++++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/gns/Makefile.am b/src/gns/Makefile.am index 0513dfe82..2e5aa193a 100644 --- a/src/gns/Makefile.am +++ b/src/gns/Makefile.am @@ -37,6 +37,8 @@ bin_PROGRAMS = \ $(DO_PROXY) \ gnunet-gns +bin_SCRIPTS=gnunet-gns-proxy-setup-ca + check_PROGRAMS = \ test_gns_simple_shorten \ test_gns_simple_get_authority \ diff --git a/src/gns/gnunet-gns-proxy-setup-ca b/src/gns/gnunet-gns-proxy-setup-ca index e25ccfc6c..507123594 100644 --- a/src/gns/gnunet-gns-proxy-setup-ca +++ b/src/gns/gnunet-gns-proxy-setup-ca @@ -9,9 +9,23 @@ cp gnscacert.pem $HOME/.gnunet/gns/gnscert.pem cat gnscacert.pem > $HOME/.gnunet/gns/gnsCAcert.pem cat gnscakeynoenc.pem >> $HOME/.gnunet/gns/gnsCAcert.pem +echo "Importing CA into browsers" +for f in ~/.mozilla/firefox/*.default +do + if [ -d $f ]; then + echo "Importing CA info firefox $f" + certutil -D -n "GNS Proxy CA" -d ~/.mozilla/firefox/*.default >/dev/null 2&>1 + certutil -A -n "GNS Proxy CA" -t CT,, -d ~/.mozilla/firefox/*.default < gnscacert.pem + fi +done + +if [ -d ~/.pki/nssdb ]; then + echo "Importing CA into chrome" + certutil -D -n "GNS Proxy CA" -d ~/.pki/nssdb >/dev/null 2&>1 + certutil -A -n "GNS Proxy CA" -t CT,, -d ~/.pki/nssdb < gnscacert.pem +fi + + rm gnscakey.pem gnscakeynoenc.pem gnscacert.pem -echo "Next steps:" -echo "1. The new CA will be used automatically by the proxy with the default settings" -echo "2. Please import the certificate $HOME/.gnunet/gns/gnscert.pem into the browser of your choice" -echo "3. Start gnunet-gns-proxy and configure your browser to use a SOCKS proxy on port 7777" +echo "You can now start gnunet-gns-proxy and configure your browser to use a SOCKS proxy on port 7777" -- 2.25.1