diff tests/test-https.t @ 13192:4d03707916d3 stable

https: use web.cacerts configuration from local repo to validate remote repo
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 27 Dec 2010 17:49:58 +0100
parents 2fa2e6444645
children b335882c2f21
line wrap: on
line diff
--- a/tests/test-https.t	Wed Dec 22 13:25:00 2010 -0600
+++ b/tests/test-https.t	Mon Dec 27 17:49:58 2010 +0100
@@ -126,7 +126,7 @@
   adding bar
   $ cd ..
 
-pull
+pull without cacert
 
   $ cd copy-pull
   $ echo '[hooks]' >> .hg/hgrc
@@ -143,12 +143,28 @@
   (run 'hg update' to get a working copy)
   $ cd ..
 
-cacert
+cacert configured in local repo
 
-  $ hg -R copy-pull pull --config web.cacerts=pub.pem
+  $ cp copy-pull/.hg/hgrc copy-pull/.hg/hgrc.bu
+  $ echo "[web]" >> copy-pull/.hg/hgrc
+  $ echo "cacerts=`pwd`/pub.pem" >> copy-pull/.hg/hgrc
+  $ hg -R copy-pull pull --traceback
   pulling from https://localhost:$HGPORT/
   searching for changes
   no changes found
+  $ mv copy-pull/.hg/hgrc.bu copy-pull/.hg/hgrc
+
+cacert configured globally
+
+  $ echo "[web]" >> $HGRCPATH
+  $ echo "cacerts=`pwd`/pub.pem" >> $HGRCPATH
+  $ hg -R copy-pull pull
+  pulling from https://localhost:$HGPORT/
+  searching for changes
+  no changes found
+
+cacert mismatch
+
   $ hg -R copy-pull pull --config web.cacerts=pub.pem https://127.0.0.1:$HGPORT/
   abort: 127.0.0.1 certificate error: certificate is for localhost
   [255]