##// END OF EJS Templates
https: use web.cacerts configuration from local repo to validate remote repo
Mads Kiilerich -
r13192:4d037079 stable
parent child Browse files
Show More
@@ -545,9 +545,12 b' def remoteui(src, opts):'
545 if r:
545 if r:
546 dst.setconfig('bundle', 'mainreporoot', r)
546 dst.setconfig('bundle', 'mainreporoot', r)
547
547
548 # copy auth and http_proxy section settings
548 # copy selected local settings to the remote ui
549 for sect in ('auth', 'http_proxy'):
549 for sect in ('auth', 'http_proxy'):
550 for key, val in src.configitems(sect):
550 for key, val in src.configitems(sect):
551 dst.setconfig(sect, key, val)
551 dst.setconfig(sect, key, val)
552 v = src.config('web', 'cacerts')
553 if v:
554 dst.setconfig('web', 'cacerts', v)
552
555
553 return dst
556 return dst
@@ -126,7 +126,7 b' clone via pull'
126 adding bar
126 adding bar
127 $ cd ..
127 $ cd ..
128
128
129 pull
129 pull without cacert
130
130
131 $ cd copy-pull
131 $ cd copy-pull
132 $ echo '[hooks]' >> .hg/hgrc
132 $ echo '[hooks]' >> .hg/hgrc
@@ -143,12 +143,28 b' pull'
143 (run 'hg update' to get a working copy)
143 (run 'hg update' to get a working copy)
144 $ cd ..
144 $ cd ..
145
145
146 cacert
146 cacert configured in local repo
147
147
148 $ hg -R copy-pull pull --config web.cacerts=pub.pem
148 $ cp copy-pull/.hg/hgrc copy-pull/.hg/hgrc.bu
149 $ echo "[web]" >> copy-pull/.hg/hgrc
150 $ echo "cacerts=`pwd`/pub.pem" >> copy-pull/.hg/hgrc
151 $ hg -R copy-pull pull --traceback
149 pulling from https://localhost:$HGPORT/
152 pulling from https://localhost:$HGPORT/
150 searching for changes
153 searching for changes
151 no changes found
154 no changes found
155 $ mv copy-pull/.hg/hgrc.bu copy-pull/.hg/hgrc
156
157 cacert configured globally
158
159 $ echo "[web]" >> $HGRCPATH
160 $ echo "cacerts=`pwd`/pub.pem" >> $HGRCPATH
161 $ hg -R copy-pull pull
162 pulling from https://localhost:$HGPORT/
163 searching for changes
164 no changes found
165
166 cacert mismatch
167
152 $ hg -R copy-pull pull --config web.cacerts=pub.pem https://127.0.0.1:$HGPORT/
168 $ hg -R copy-pull pull --config web.cacerts=pub.pem https://127.0.0.1:$HGPORT/
153 abort: 127.0.0.1 certificate error: certificate is for localhost
169 abort: 127.0.0.1 certificate error: certificate is for localhost
154 [255]
170 [255]
General Comments 0
You need to be logged in to leave comments. Login now