Skip to content
Snippets Groups Projects
Commit 4d037079 authored by kiilerix's avatar kiilerix
Browse files

https: use web.cacerts configuration from local repo to validate remote repo

parent 6c9345f9
No related branches found
No related tags found
No related merge requests found
......@@ -545,7 +545,7 @@
if r:
dst.setconfig('bundle', 'mainreporoot', r)
# copy auth and http_proxy section settings
# copy selected local settings to the remote ui
for sect in ('auth', 'http_proxy'):
for key, val in src.configitems(sect):
dst.setconfig(sect, key, val)
......@@ -549,5 +549,8 @@
for sect in ('auth', 'http_proxy'):
for key, val in src.configitems(sect):
dst.setconfig(sect, key, val)
v = src.config('web', 'cacerts')
if v:
dst.setconfig('web', 'cacerts', v)
return dst
......@@ -126,7 +126,7 @@
adding bar
$ cd ..
pull
pull without cacert
$ cd copy-pull
$ echo '[hooks]' >> .hg/hgrc
......@@ -143,5 +143,5 @@
(run 'hg update' to get a working copy)
$ cd ..
cacert
cacert configured in local repo
......@@ -147,5 +147,8 @@
$ 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
......@@ -149,6 +152,19 @@
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]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment