"Fossies" - the Fresh Open Source Software Archive

Member "hitch-1.5.2/src/tests/test04-listen-with-own-certs.sh" (27 Aug 2019, 711 Bytes) of package /linux/www/hitch-1.5.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "test04-listen-with-own-certs.sh": 1.4.8_vs_1.5.0.

    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 s_client_parse s_client1.dump
   17 run_cmd test "$SUBJECT_NAME" = "site1.example.com"
   18 
   19 # Second listen port.
   20 s_client -connect localhost:$PORT2 >s_client2.dump
   21 s_client_parse s_client2.dump
   22 run_cmd test "$SUBJECT_NAME" = "site2.example.com"
   23 
   24 for host in $(hitch_hosts)
   25 do
   26     curl_hitch -- "https://$host/"
   27 done