GithubHelp home page GithubHelp logo

bhanditz / root_certificates Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dart-lang/root_certificates

0.0 2.0 0.0 1.35 MB

The set of root certificates trusted by dart:io's default SecurityContext. Taken from Mozilla's NSS library.

License: Mozilla Public License 2.0

C++ 100.00%

root_certificates's Introduction

Name: Root certificates for trusted CAs
Short Name: root_certificates
URL: https://github.com/dart-lang/root_certificates
Version: 0.2
Date: Jan 9, 2017
License: MPL/2.0, https://www.mozilla.org/MPL/2.0/

Description:
This directory contains the root CA certificates chosen to be trusted by
Mozilla's NSS library, reformatted into an array in C source code, to be
used by the default SecurityContext obect in Dart's dart:io library for
secure networking (TLS, SSL) for operating systems that don't have a supported
certificate store.

The files can be updated as follows:

1. Fetch the certificates from Mozilla with this command line:

curl https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt -o certdata.txt

2. Convert from Mozilla format to PEM format by running the utility
at https://github.com/agl/extract-nss-root-certs:

go run convert_mozilla_certdata.go > certdata.pem

Note that this utility produces a warning about one certificate with a negative
serial number.  This is expected.

3. Strip comments from this file to decrease the size of the string
that will be compiled into the Dart executable:

sed '/^#/d' ./certdata.pem > ./certdata.stripped

4. Convert the stripped file to a C character array with the xxd utility:

xxd -i certdata.stripped > certdata.cc

5. Make the following changes to certdata.cc:
   - Copy the MPL copyright header from root_certificates.cc to certdata.cc.
   - Update the conversion date in the copyright comment.
   - Copy the #ifdef/#endif and  namespace declarations from
      root_certificates.cc into certdata.cc.
   - Rename the array variable from certdata_stripped to root_certificates_pem_.
   - Rename the variable containing the array length from
     certdata_stripped_length to root_certificates_pem_length.
   - Above the declaration for root_certificates_pem_length, add this line:
     const unsigned char* root_certificates_pem = root_certificates_pem_;

6. Update root_certificates.cc as follows:

mv certdata.cc root_certificates.cc

root_certificates's People

Contributors

zanderso avatar jimbeveridge avatar whesse avatar rmacnak-google avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.