tests/test-https.t
changeset 29446 2f7f1e10f840
parent 29445 072e4a595607
child 29448 afbe1fe4c44e
equal deleted inserted replaced
29445:072e4a595607 29446:2f7f1e10f840
    60   [255]
    60   [255]
    61 
    61 
    62 A malformed per-host certificate file will raise an error
    62 A malformed per-host certificate file will raise an error
    63 
    63 
    64   $ echo baddata > badca.pem
    64   $ echo baddata > badca.pem
       
    65 #if sslcontext
       
    66   $ hg --config hostsecurity.localhost:verifycertsfile=badca.pem clone https://localhost:$HGPORT/
       
    67   abort: error loading CA file badca.pem: * (glob)
       
    68   (file is empty or malformed?)
       
    69   [255]
       
    70 #else
    65   $ hg --config hostsecurity.localhost:verifycertsfile=badca.pem clone https://localhost:$HGPORT/
    71   $ hg --config hostsecurity.localhost:verifycertsfile=badca.pem clone https://localhost:$HGPORT/
    66   abort: error: * (glob)
    72   abort: error: * (glob)
    67   [255]
    73   [255]
       
    74 #endif
    68 
    75 
    69 A per-host certificate mismatching the server will fail verification
    76 A per-host certificate mismatching the server will fail verification
    70 
    77 
    71   $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/client-cert.pem" clone https://localhost:$HGPORT/
    78   $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/client-cert.pem" clone https://localhost:$HGPORT/
    72   abort: error: *certificate verify failed* (glob)
    79   abort: error: *certificate verify failed* (glob)
   181   no changes found
   188   no changes found
   182 
   189 
   183 empty cacert file
   190 empty cacert file
   184 
   191 
   185   $ touch emptycafile
   192   $ touch emptycafile
       
   193 
       
   194 #if sslcontext
   186   $ hg --config web.cacerts=emptycafile -R copy-pull pull
   195   $ hg --config web.cacerts=emptycafile -R copy-pull pull
   187   pulling from https://localhost:$HGPORT/
   196   pulling from https://localhost:$HGPORT/
       
   197   abort: error loading CA file emptycafile: * (glob)
       
   198   (file is empty or malformed?)
       
   199   [255]
       
   200 #else
       
   201   $ hg --config web.cacerts=emptycafile -R copy-pull pull
       
   202   pulling from https://localhost:$HGPORT/
   188   abort: error: * (glob)
   203   abort: error: * (glob)
   189   [255]
   204   [255]
       
   205 #endif
   190 
   206 
   191 cacert mismatch
   207 cacert mismatch
   192 
   208 
   193   $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub.pem" \
   209   $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub.pem" \
   194   > https://127.0.0.1:$HGPORT/
   210   > https://127.0.0.1:$HGPORT/