tests/test-https.t
changeset 29449 5b71a8d7f7ff
parent 29448 afbe1fe4c44e
child 29481 5caa415aa48b
equal deleted inserted replaced
29448:afbe1fe4c44e 29449:5b71a8d7f7ff
    47 Our test cert is not signed by a trusted CA. It should fail to verify if
    47 Our test cert is not signed by a trusted CA. It should fail to verify if
    48 we are able to load CA certs.
    48 we are able to load CA certs.
    49 
    49 
    50 #if defaultcacerts
    50 #if defaultcacerts
    51   $ hg clone https://localhost:$HGPORT/ copy-pull
    51   $ hg clone https://localhost:$HGPORT/ copy-pull
       
    52   (an attempt was made to load CA certificates but none were loaded; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error)
    52   abort: error: *certificate verify failed* (glob)
    53   abort: error: *certificate verify failed* (glob)
    53   [255]
    54   [255]
    54 #else
    55 #else
    55   $ hg clone https://localhost:$HGPORT/ copy-pull
    56   $ hg clone https://localhost:$HGPORT/ copy-pull
    56   abort: localhost certificate error: no certificate received
    57   abort: localhost certificate error: no certificate received
    78   [255]
    79   [255]
    79 #endif
    80 #endif
    80 
    81 
    81 A per-host certificate mismatching the server will fail verification
    82 A per-host certificate mismatching the server will fail verification
    82 
    83 
       
    84 (modern ssl is able to discern whether the loaded cert is a CA cert)
       
    85 #if sslcontext
    83   $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/client-cert.pem" clone https://localhost:$HGPORT/
    86   $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/client-cert.pem" clone https://localhost:$HGPORT/
    84   abort: error: *certificate verify failed* (glob)
    87   (an attempt was made to load CA certificates but none were loaded; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error)
    85   [255]
    88   abort: error: *certificate verify failed* (glob)
       
    89   [255]
       
    90 #else
       
    91   $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/client-cert.pem" clone https://localhost:$HGPORT/
       
    92   abort: error: *certificate verify failed* (glob)
       
    93   [255]
       
    94 #endif
    86 
    95 
    87 A per-host certificate matching the server's cert will be accepted
    96 A per-host certificate matching the server's cert will be accepted
    88 
    97 
    89   $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/pub.pem" clone -U https://localhost:$HGPORT/ perhostgood1
    98   $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/pub.pem" clone -U https://localhost:$HGPORT/ perhostgood1
    90   requesting all changes
    99   requesting all changes