tests/test-https.t
changeset 28847 3e576fe66715
parent 28549 e01bd7385f4f
child 29263 817ee3cfe862
equal deleted inserted replaced
28846:18f2fc517098 28847:3e576fe66715
   169 #if defaultcacerts
   169 #if defaultcacerts
   170   $ hg clone https://localhost:$HGPORT/ copy-pull
   170   $ hg clone https://localhost:$HGPORT/ copy-pull
   171   abort: error: *certificate verify failed* (glob)
   171   abort: error: *certificate verify failed* (glob)
   172   [255]
   172   [255]
   173 
   173 
   174   $ DISABLEOSXDUMMYCERT="--config=web.cacerts=!"
   174   $ DISABLEOSXDUMMYCERT="--insecure"
   175 #endif
   175 #endif
   176 
   176 
   177 clone via pull
   177 clone via pull
   178 
   178 
   179   $ hg clone https://localhost:$HGPORT/ copy-pull $DISABLEOSXDUMMYCERT
   179   $ hg clone https://localhost:$HGPORT/ copy-pull $DISABLEOSXDUMMYCERT
   285   $ echo "[hostfingerprints]" >> copy-pull/.hg/hgrc
   285   $ echo "[hostfingerprints]" >> copy-pull/.hg/hgrc
   286   $ echo "localhost = 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca" >> copy-pull/.hg/hgrc
   286   $ echo "localhost = 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca" >> copy-pull/.hg/hgrc
   287   $ echo "127.0.0.1 = 914f1aff87249c09b6859b88b1906d30756491ca" >> copy-pull/.hg/hgrc
   287   $ echo "127.0.0.1 = 914f1aff87249c09b6859b88b1906d30756491ca" >> copy-pull/.hg/hgrc
   288 
   288 
   289 - works without cacerts
   289 - works without cacerts
   290   $ hg -R copy-pull id https://localhost:$HGPORT/ --config web.cacerts=!
   290   $ hg -R copy-pull id https://localhost:$HGPORT/ --insecure
   291   5fed3813f7f5
   291   5fed3813f7f5
   292 
   292 
   293 - multiple fingerprints specified and first matches
   293 - multiple fingerprints specified and first matches
   294   $ hg --config 'hostfingerprints.localhost=914f1aff87249c09b6859b88b1906d30756491ca, deadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ --config web.cacerts=!
   294   $ hg --config 'hostfingerprints.localhost=914f1aff87249c09b6859b88b1906d30756491ca, deadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ --insecure
   295   5fed3813f7f5
   295   5fed3813f7f5
   296 
   296 
   297 - multiple fingerprints specified and last matches
   297 - multiple fingerprints specified and last matches
   298   $ hg --config 'hostfingerprints.localhost=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, 914f1aff87249c09b6859b88b1906d30756491ca' -R copy-pull id https://localhost:$HGPORT/ --config web.cacerts=!
   298   $ hg --config 'hostfingerprints.localhost=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, 914f1aff87249c09b6859b88b1906d30756491ca' -R copy-pull id https://localhost:$HGPORT/ --insecure
   299   5fed3813f7f5
   299   5fed3813f7f5
   300 
   300 
   301 - multiple fingerprints specified and none match
   301 - multiple fingerprints specified and none match
   302 
   302 
   303   $ hg --config 'hostfingerprints.localhost=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, aeadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ --config web.cacerts=!
   303   $ hg --config 'hostfingerprints.localhost=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, aeadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ --insecure
   304   abort: certificate for localhost has unexpected fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca
   304   abort: certificate for localhost has unexpected fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca
   305   (check hostfingerprint configuration)
   305   (check hostfingerprint configuration)
   306   [255]
   306   [255]
   307 
   307 
   308 - fails when cert doesn't match hostname (port is ignored)
   308 - fails when cert doesn't match hostname (port is ignored)