Bug 20356 - mozroots silently timesout when downloading certdata from mxr.mozilla.org when built from master source
Summary: mozroots silently timesout when downloading certdata from mxr.mozilla.org whe...
Status: NEW
Alias: None
Product: Tools
Classification: Mono
Component: other ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-06-04 18:25 UTC by Mike Minns
Modified: 2014-06-04 18:26 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Patch mozroots to up the default timeout and provide an override mechanism (2.18 KB, patch)
2014-06-04 18:26 UTC, Mike Minns
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 20356 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Mike Minns 2014-06-04 18:25:04 UTC
I've been attempting to build Mono from master source on my Ubuntu 12.04 box.

I deliberately blew away my existing Mono installation before building.

autogen, make etc went through OK, but when trying to import the certdata using mozroots.exe it keeps failing, as shown here: 

$ mozroots --import --sync
Mozilla Roots Importer - version 3.6.1.0
Download and import trusted root certificates from Mozilla's MXR.
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed.

Downloading from 'http://mxr.mozilla.org/seamonkey/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1'...
Couldn't retrieve the file using the supplied information.


Looking into https://github.com/mono/mono/blob/master/mcs/tools/security/mozroots.cs#L82 there is a hardcoded timeout of 10,000ms. 

Also there is no detail provided when the download fails: https://github.com/mono/mono/blob/master/mcs/tools/security/mozroots.cs#L86

Removing the timeout override and allowing it to default to 100000ms fixes the problem.


Attached is a patch which changes the default back to 100000ms, provides a command line parameter for overriding the default and logging of when it has been overridden. 

I don't know if this masks some deeper issue but the patch fixes the problem for me

$ mono ./mozroots.exe --import --sync
Mozilla Roots Importer - version 3.6.1.0
Download and import trusted root certificates from Mozilla's MXR.
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed.

Downloading from 'http://mxr.mozilla.org/seamonkey/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1'...
Importing certificates into user store...
139 new root certificates were added to your trust store.
Import process completed.
Comment 1 Mike Minns 2014-06-04 18:26:35 UTC
Created attachment 6983 [details]
Patch mozroots to up the default timeout and provide an override mechanism

My first patch, please let me know if there are any issues with the format etc.