1 #!/bin/sh 2 # 3 # Test multiple listening sockets, each with their own certificate. 4 # 5 . hitch_test.sh 6 7 PORT2=$(expr $$ % 60000 + 4000) 8 9 start_hitch \ 10 --backend='[hitch-tls.org]:80' \ 11 --frontend="[localhost]:$LISTENPORT+${CERTSDIR}/site1.example.com" \ 12 --frontend="[localhost]:$PORT2+${CERTSDIR}/site2.example.com" \ 13 "${CERTSDIR}/default.example.com" 14 15 s_client -connect localhost:$LISTENPORT >s_client1.dump 16 subject_field_eq CN site1.example.com s_client1.dump 17 18 # Second listen port. 19 s_client -connect localhost:$PORT2 >s_client2.dump 20 subject_field_eq CN site2.example.com s_client2.dump 21 22 for host in $(hitch_hosts) 23 do 24 curl_hitch -- "https://$host/" 25 done