"Fossies" - the Fresh Open Source Software Archive

Member "hitch-1.7.2/src/tests/test05-multiple-listen-SNI.sh" (29 Nov 2021, 1125 Bytes) of package /linux/www/hitch-1.7.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 and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "test05-multiple-listen-SNI.sh": 1.7.0_vs_1.7.2.

    1 #!/bin/sh
    2 #
    3 # Test multiple certificates (SNI) on a listening socket.
    4 
    5 . hitch_test.sh
    6 
    7 start_hitch \
    8     --backend='[hitch-tls.org]:80' \
    9     --frontend="[localhost]:$LISTENPORT" \
   10     "${CERTSDIR}/site1.example.com" \
   11     "${CERTSDIR}/site2.example.com" \
   12     "${CERTSDIR}/default.example.com"
   13 
   14 s_client >no-sni.dump
   15 subject_field_eq CN "default.example.com" no-sni.dump
   16 
   17 # send a SNI request
   18 s_client -servername site1.example.com >sni.dump
   19 subject_field_eq CN "site1.example.com" sni.dump
   20 
   21 curl_hitch
   22 
   23 stop_hitch
   24 
   25 cat >hitch.cfg <<EOF
   26 frontend = {
   27        host = "localhost"
   28        port = "$LISTENPORT"
   29 
   30        pem-file = "${CERTSDIR}/site1.example.com"
   31        pem-file = "${CERTSDIR}/site2.example.com"
   32        pem-file = "${CERTSDIR}/default.example.com"
   33 }
   34 
   35 backend = "[hitch-tls.org]:80"
   36 EOF
   37 
   38 start_hitch --config=hitch.cfg
   39 
   40 s_client >cfg-no-sni.dump
   41 subject_field_eq CN "default.example.com" cfg-no-sni.dump
   42 
   43 s_client -servername site1.example.com >cfg-sni.dump
   44 subject_field_eq CN "site1.example.com" cfg-sni.dump
   45 
   46 s_client -servername SITE1.EXAMPLE.COM >cfg-sni-upper.dump
   47 subject_field_eq CN "site1.example.com" cfg-sni-upper.dump