summaryrefslogtreecommitdiff
path: root/test/auth.sh
blob: 608b4fdbdd3e7e140e15b5011cbc6333123858c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

FILE=`mktemp`

cat > $FILE <<EOF
T t
X x
EOF

trap 'unlink $FILE' EXIT

ROOT=$(dirname $0)/..
PATH=$ROOT/bin:$PATH

tunnel add name T listen,addr=%2000 auth dump aes dial,addr=%3000
tunnel add name X listen,addr=%3000 /aes /auth dial,addr=%4000
tunnel set authfile $FILE
tunnel set tunnel.T.authuser T
tunnel set tunnel.X.authuser X
nc -l 4000 &
echo "Hello, World!" | nc -N localhost 2000
wait
tunnel clear
tunnel del T
tunnel del X