"Fossies" - the Fresh Open Source Software Archive

Member "hitch-1.5.2/src/tests/test29-pem-dir.sh" (27 Aug 2019, 1682 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.

    1 #!/bin/sh
    2 #
    3 # Test pem-dir & pem-dir-glob options
    4 #
    5 . hitch_test.sh
    6 cat >hitch.cfg <<EOF
    7 frontend = {
    8     host = "localhost"
    9     port = "$LISTENPORT"
   10 }
   11 
   12 pem-dir = "${CERTSDIR}/pemdirtest"
   13 sni-nomatch-abort = on
   14 EOF
   15 
   16 start_hitch --config=hitch.cfg
   17 
   18 
   19 if openssl s_client -help 2>&1 | grep -q -e -noservername;
   20 then
   21     NOSNI="-noservername"
   22 else
   23     NOSNI=""
   24 fi
   25 
   26 s_client -servername site1.example.com -connect localhost:$LISTENPORT >site1.dump
   27 subj_name_eq "site1.example.com" site1.dump
   28 
   29 s_client -servername site2.example.com -connect localhost:$LISTENPORT >site2.dump
   30 subj_name_eq "site2.example.com" site2.dump
   31 
   32 s_client -servername default.example.com -connect localhost:$LISTENPORT >default.dump
   33 subj_name_eq "default.example.com" default.dump
   34 
   35 ! s_client -servername invalid.example.com -connect localhost:$LISTENPORT >unknown.dump
   36 run_cmd grep 'unrecognized name' unknown.dump
   37 
   38 
   39 stop_hitch
   40 cat >hitch.cfg <<EOF
   41 frontend = {
   42     host = "localhost"
   43     port = "$LISTENPORT"
   44 }
   45 
   46 pem-dir = "${CERTSDIR}/pemdirtest"
   47 pem-dir-glob = "*site*"
   48 sni-nomatch-abort = on
   49 EOF
   50 
   51 start_hitch --config=hitch.cfg
   52 
   53 s_client -servername site1.example.com -connect localhost:$LISTENPORT >site1.dump
   54 subj_name_eq "site1.example.com" site1.dump
   55 
   56 s_client -servername site2.example.com -connect localhost:$LISTENPORT >site2.dump
   57 subj_name_eq "site2.example.com" site2.dump
   58 
   59 s_client -servername site3.example.com -connect localhost:$LISTENPORT >site3.dump
   60 subj_name_eq "site3.example.com" site3.dump
   61 
   62 ! s_client -servername default.example.com -connect localhost:$LISTENPORT >default.dump
   63 run_cmd grep 'unrecognized name' unknown.dump
   64 
   65 s_client $NOSNI >cfg-no-sni.dump
   66 subj_name_eq "site1.example.com" cfg-no-sni.dump
   67