Bug 825277 - Set web.cacerts so Mercurial trusts OS CA certificates by default
Summary: Set web.cacerts so Mercurial trusts OS CA certificates by default
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mercurial
Version: 16
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Neal Becker
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-25 14:31 UTC by David North
Modified: 2012-06-22 08:29 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-25 14:49:53 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Mercurial 3453 0 None None None Never

Description David North 2012-05-25 14:31:20 UTC
Description of problem:

Because Python's SSL support is unhelpful in this regard, Mercurial does not trust any certificate authorities by default.

This leaves the user either whitelisting https hosts on a case-by-case basis, or having to configure the CA certificates themselves.

Since Fedora ships them, it could trivially set the web.cacerts Mercurial setting to point to the OS CA certificates - thus meaning properly-configured HTTPS Mercurial sites will work out of the box.


Version-Release number of selected component (if applicable):


How reproducible: Always


Steps to Reproduce:
1. hg clone https://bitbucket.org/davidnorth/eximunit
  
Actual results:

See lots of warnings about bitbucket.org certificate with fingerprint [...] not verified (check hostfingerprints or web.cacerts config setting)

Expected results:

No warnings.

Additional info:

Drop a file into /etc/mercurial/hgrc.d containing the lines:

[web]
cacerts = /etc/pki/tls/certs/ca-bundle.crt

... and the problem is solved.

Comment 1 David North 2012-05-25 14:33:16 UTC
For the record, filed this upstream at http://bz.selenic.com/show_bug.cgi?id=3453, but they suffer from not knowing where to find the OS certs, since that's OS-specific. They weren't keen on hard-coding heuristics either.

Comment 2 Neal Becker 2012-05-25 14:49:53 UTC
OK, done.

Comment 3 Mads Kiilerich 2012-05-25 14:59:49 UTC
It would perhaps be helful to add comment to the config file with a link to http://mercurial.selenic.com/wiki/CACertificates ... and perhaps also update the status on that page.

It is a 'big' behavioural change that shouldn't be done in released and 'stable' Fedora versions, but you could perhaps sneak it in as a 0-day update to f17 ... or wait for 2.2.2 in a week.

Comment 4 Fedora Update System 2012-06-04 13:34:44 UTC
mercurial-2.2.2-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/mercurial-2.2.2-1.fc17

Comment 5 Fedora Update System 2012-06-22 08:29:58 UTC
mercurial-2.2.2-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.