tests/test-https.t
branchstable
changeset 13314 8dc488dfcdb4
parent 13231 b335882c2f21
child 13328 a939f08fae9c
equal deleted inserted replaced
13312:9f188734dbb0 13314:8dc488dfcdb4
   104   $ cd ..
   104   $ cd ..
   105 
   105 
   106 clone via pull
   106 clone via pull
   107 
   107 
   108   $ hg clone https://localhost:$HGPORT/ copy-pull
   108   $ hg clone https://localhost:$HGPORT/ copy-pull
   109   warning: localhost certificate not verified (check web.cacerts config setting)
   109   warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
   110   requesting all changes
   110   requesting all changes
   111   adding changesets
   111   adding changesets
   112   adding manifests
   112   adding manifests
   113   adding file changes
   113   adding file changes
   114   added 1 changesets with 4 changes to 4 files
   114   added 1 changesets with 4 changes to 4 files
   130 
   130 
   131   $ cd copy-pull
   131   $ cd copy-pull
   132   $ echo '[hooks]' >> .hg/hgrc
   132   $ echo '[hooks]' >> .hg/hgrc
   133   $ echo "changegroup = python '$TESTDIR'/printenv.py changegroup" >> .hg/hgrc
   133   $ echo "changegroup = python '$TESTDIR'/printenv.py changegroup" >> .hg/hgrc
   134   $ hg pull
   134   $ hg pull
   135   warning: localhost certificate not verified (check web.cacerts config setting)
   135   warning: localhost certificate with fingerprint 91:4f:1a:ff:87:24:9c:09:b6:85:9b:88:b1:90:6d:30:75:64:91:ca not verified (check hostfingerprints or web.cacerts config setting)
   136   changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=https://localhost:$HGPORT/ 
   136   changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=https://localhost:$HGPORT/ 
   137   pulling from https://localhost:$HGPORT/
   137   pulling from https://localhost:$HGPORT/
   138   searching for changes
   138   searching for changes
   139   adding changesets
   139   adding changesets
   140   adding manifests
   140   adding manifests
   186   $ hg -R test serve -p $HGPORT2 -d --pid-file=hg2.pid --certificate=server-expired.pem  
   186   $ hg -R test serve -p $HGPORT2 -d --pid-file=hg2.pid --certificate=server-expired.pem  
   187   $ cat hg2.pid >> $DAEMON_PIDS
   187   $ cat hg2.pid >> $DAEMON_PIDS
   188   $ hg -R copy-pull pull --config web.cacerts=pub-expired.pem https://localhost:$HGPORT2/
   188   $ hg -R copy-pull pull --config web.cacerts=pub-expired.pem https://localhost:$HGPORT2/
   189   abort: error: *:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (glob)
   189   abort: error: *:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (glob)
   190   [255]
   190   [255]
       
   191 
       
   192 Fingerprints
       
   193 
       
   194   $ echo "[hostfingerprints]" >> copy-pull/.hg/hgrc
       
   195   $ 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
       
   196   $ echo "127.0.0.1 = 914f1aff87249c09b6859b88b1906d30756491ca" >> copy-pull/.hg/hgrc
       
   197 
       
   198 - works without cacerts
       
   199   $ hg -R copy-pull id https://localhost:$HGPORT/ --config web.cacerts=
       
   200   5fed3813f7f5
       
   201 
       
   202 - fails when cert doesn't match hostname (port is ignored)
       
   203   $ hg -R copy-pull id https://localhost:$HGPORT1/
       
   204   abort: invalid certificate for localhost with fingerprint 28:ff:71:bf:65:31:14:23:ad:62:92:b4:0e:31:99:18:fc:83:e3:9b
       
   205   [255]
       
   206 
       
   207 - ignores that certificate doesn't match hostname
       
   208   $ hg -R copy-pull id https://127.0.0.1:$HGPORT/
       
   209   5fed3813f7f5