diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-01-25 20:52:55 +0100 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-01-25 20:52:55 +0100 |
commit | 7f666b4467ae5f530e904675df3f28886f4202fa (patch) | |
tree | 7bceb77a3b5de5fc8ec48bf8211d8bcd239f08fb /src/gns/test_proxy.sh | |
parent | 92d1fd704da83c27e9aac3d385b8dd6cf0c18a8a (diff) | |
download | gnunet-7f666b4467ae5f530e904675df3f28886f4202fa.tar.gz gnunet-7f666b4467ae5f530e904675df3f28886f4202fa.zip |
Fix #5514; Add test for GNS Proxy and DANE; Fix TLS connections on ports != 443 through proxy
Diffstat (limited to 'src/gns/test_proxy.sh')
-rwxr-xr-x | src/gns/test_proxy.sh | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/gns/test_proxy.sh b/src/gns/test_proxy.sh new file mode 100755 index 000000000..c960d4df9 --- /dev/null +++ b/src/gns/test_proxy.sh | |||
@@ -0,0 +1,53 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | TEST_DOMAIN="www.test" | ||
4 | |||
5 | gnunet-arm -s -c test_gns_proxy.conf | ||
6 | gnunet-gns-proxy-setup-ca -c test_gns_proxy.conf | ||
7 | |||
8 | openssl genrsa -des3 -passout pass:xxxx -out server.pass.key 2048 | ||
9 | openssl rsa -passin pass:xxxx -in server.pass.key -out local.key | ||
10 | rm server.pass.key | ||
11 | openssl req -new -key local.key -out server.csr \ | ||
12 | -subj "/C=DE/O=GNUnet/OU=GNS/CN=test.local" | ||
13 | openssl x509 -req -days 1 -in server.csr -signkey local.key -out local.crt | ||
14 | openssl x509 -in local.crt -out local.der -outform DER | ||
15 | HEXCERT=`xxd -p local.der | tr -d '\n'` | ||
16 | #echo "This is the certificate the server does not use: $HEXCERT" | ||
17 | OLDBOXVALUE="6 8443 52 3 0 0 $HEXCERT" | ||
18 | |||
19 | |||
20 | openssl req -new -key local.key -out server.csr \ | ||
21 | -subj "/C=DE/O=GNUnet/OU=GNS/CN=test.local" | ||
22 | openssl x509 -req -days 1 -in server.csr -signkey local.key -out local.crt | ||
23 | openssl x509 -in local.crt -out local.der -outform DER | ||
24 | HEXCERT=`xxd -p local.der | tr -d '\n'` | ||
25 | #echo "This is the certificate the server does use: $HEXCERT" | ||
26 | BOXVALUE="6 8443 52 3 0 0 $HEXCERT" | ||
27 | |||
28 | cat local.crt > /tmp/server_cacert.pem | ||
29 | cat local.key >> /tmp/server_cacert.pem | ||
30 | |||
31 | gnunet-identity -C test -c test_gns_proxy.conf | ||
32 | gnunet-namestore -p -z test -a -n www -t A -V 127.0.0.1 -e never -c test_gns_proxy.conf | ||
33 | gnunet-namestore -p -z test -a -n www -t LEHO -V "test.local" -e never -c test_gns_proxy.conf | ||
34 | gnunet-namestore -p -z test -a -n www -t BOX -V "$OLDBOXVALUE" -e never -c test_gns_proxy.conf | ||
35 | gnunet-namestore -p -z test -a -n www -t BOX -V "$BOXVALUE" -e never -c test_gns_proxy.conf | ||
36 | |||
37 | gnunet-arm -i gns-proxy -c test_gns_proxy.conf | ||
38 | |||
39 | #gnurl --socks5-hostname 127.0.0.1:7777 https://www.test -v --cacert /tmp/proxy_cacert.pem | ||
40 | ./test_gns_proxy -A /tmp/proxy_cacert.pem -S /tmp/server_cacert.pem -p 8443 -c test_gns_proxy.conf | ||
41 | |||
42 | RES=$? | ||
43 | |||
44 | rm /tmp/proxy_cacert.pem | ||
45 | rm /tmp/server_cacert.pem | ||
46 | |||
47 | gnunet-arm -e test_gns_proxy.conf | ||
48 | |||
49 | if test $RES != 0 | ||
50 | then | ||
51 | echo "Failed" | ||
52 | exit 1 | ||
53 | fi | ||