# HG changeset patch # User Steven Stallion <sstallion@gmail.com> # Date 2012-04-09 21:36:16 # Node ID 9cf7c9d529d056b9f6bb760cb400eea84f1b62d8 # Parent 4df76d5506a9c09fed31715242bd6a4b5d808952 ui: optionally quiesce ssl verification warnings on python 2.5 Some platforms, notably Plan 9 from Bell Labs are stuck on older releases of Python. Due to restrictions in the platform, it is not possible to backport the SSL library to the existing Python port. This patch permits the UI to quiesce SSL verification warnings by adding a configuration entry named reportoldssl to ui. diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt --- a/mercurial/help/config.txt +++ b/mercurial/help/config.txt @@ -1135,6 +1135,10 @@ User interface controls. ``remotecmd`` remote command to use for clone/push/pull operations. Default is ``hg``. +``reportoldssl`` + Warn if an SSL certificate is unable to be due to using Python + 2.5 or earlier. True or False. Default is True. + ``report_untrusted`` Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a trusted user or group. True or False. Default is True. diff --git a/mercurial/sslutil.py b/mercurial/sslutil.py --- a/mercurial/sslutil.py +++ b/mercurial/sslutil.py @@ -107,8 +107,9 @@ class validator(object): if hostfingerprint: raise util.Abort(_("host fingerprint for %s can't be " "verified (Python too old)") % host) - self.ui.warn(_("warning: certificate for %s can't be verified " - "(Python too old)\n") % host) + if self.ui.configbool('ui', 'reportoldssl', True): + self.ui.warn(_("warning: certificate for %s can't be verified " + "(Python too old)\n") % host) return if not sock.cipher(): # work around http://bugs.python.org/issue13721 raise util.Abort(_('%s ssl connection error') % host)