summaryrefslogtreecommitdiff
path: root/openssl-connect
diff options
context:
space:
mode:
Diffstat (limited to 'openssl-connect')
-rwxr-xr-xopenssl-connect8
1 files changed, 5 insertions, 3 deletions
diff --git a/openssl-connect b/openssl-connect
index 7b7c4b7..9faab3f 100755
--- a/openssl-connect
+++ b/openssl-connect
@@ -4,6 +4,7 @@
host=${1:-localhost}
portbase=${2:-4430}
+PSK=12345678
s_client_client_random() {
awk '
@@ -77,6 +78,7 @@ awk '# Look for something like ECDHE-RSA-AES256-SHA
}
}' |
while read cipher; do
+ opts=()
case $cipher in
*-ECDSA-*)
port=$((portbase+1)) ;;
@@ -85,9 +87,8 @@ while read cipher; do
*-DSS-*)
port=$((portbase+3)) ;;
PSK-*)
- echo "Skipping unsupported PSK" >&2
- continue
- ;;
+ opts+=(-psk "$PSK")
+ port=$portbase ;;
*-RSA-*|*) # assume RSA (includes name like RC4-SHA)
port=$portbase ;;
esac
@@ -98,6 +99,7 @@ while read cipher; do
printf "GET / HTTP/1.0\r\n\r\n" |
openssl s_client -connect "$host:$port" -ign_eof -cipher "$cipher" \
-no_comp \
+ "${opts[@]}" \
-msg 2>&1 | s_client_client_random
done