Search Unity

How can I add a certificate to the Mono Trust store?

Discussion in 'Scripting' started by Jason-H, Dec 16, 2015.

  1. Jason-H

    Jason-H

    Joined:
    Nov 5, 2010
    Posts:
    87
    What I want to do:

    I am trying to add a certificate to Unity to enable SSL connection. I preferably only want to approve one root certificate (GoDaddy G2 root certificate downloaded fromhttps://certs.godaddy.com/repository).

    Background

    This page on Mono Security states that I can use certmgr.exe to add certificates to the mono trust store - http://www.mono-project.com/docs/faq/security/.

    There seems to be no certmgr.exe within the mono/2.0 folder packaged with Unity (Unity\Editor\Data\Mono\lib\mono\2.0). Even though the .exe has been in mono since 1.1. The .exe does exist within the MonoBleedingEdge/4.5 folder however I believe there are different Trust stores for each folder so I believe I cannot use this.

    Question

    Am I able to use another tool / method to add the root certificate to the trust store? Or am I missing the location of the certmgr.exe in the 2.0 mono package?

    Additional Notes

    In case it makes a difference, I am trying to connect to a Learning Record Store through the Tincan API (new version of SCORM).

    I have also asked this question over at Unity Answers: http://answers.unity3d.com/questions/1112912/how-can-i-add-a-certificate-to-the-mono-trust-stor.html
     
  2. Jason-H

    Jason-H

    Joined:
    Nov 5, 2010
    Posts:
    87
  3. Tristan.fgol

    Tristan.fgol

    Joined:
    Sep 3, 2014
    Posts:
    12
    I would also like to know how to do this, I don't really fancy implementing my own certificate validation in Unity
     
  4. Jason-H

    Jason-H

    Joined:
    Nov 5, 2010
    Posts:
    87
    Hi Tristan, have you found any useful information about this issue? Or have you used a workaround for now?
     
  5. mostafaberg

    mostafaberg

    Joined:
    Apr 21, 2014
    Posts:
    1
    Strange that no one answered you, you can do that by using `mozroots.exe`, simply run:
    `mono mozroots.exe --import --sync`
    and it'll download and import all the root certs to the mono trust store, here's what i got when i ran mine:

    Code (csharp):
    1. mono mozroots.exe --import --sync
    2. Mozilla Roots Importer - version 3.4.0.0
    3. Download and import trusted root certificates from Mozilla's MXR.
    4. Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed.
    5.  
    6. Downloading from 'http://mxr.mozilla.org/seamonkey/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1'...
    7. Importing certificates into user store...
    8. 102 new root certificates were added to your trust store.
    9. Import process completed.
    Note: I also answered in more detail on your unity question on how to run on devices, etc..

    Awaiting moderation now :)
     
    Last edited: Feb 18, 2016