Skip to content

Instantly share code, notes, and snippets.

@jjb
Created May 27, 2011 22:11

Revisions

  1. jjb revised this gist May 28, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    If you want to use curl or open-uri to access https resources, you will often (always?) get an error, because they don't have the large number of root certificates installed that web browsers have.
    If you want to use curl or net-http/open-uri to access https resources, you will often (always?) get an error, because they don't have the large number of root certificates installed that web browsers have.

    You can manually install the root certs, but first you have to get them from somewhere. [This article](http://notetoself.vrensk.com/2008/09/verified-https-in-ruby/) gives a nice description of how to do that. The [source of the cert files](http://curl.haxx.se/ca/cacert.pem) it points to is hosted by the curl project, who kindly provide it in the .pem format.

  2. jjb revised this gist May 27, 2011. 1 changed file with 8 additions and 6 deletions.
    14 changes: 8 additions & 6 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -8,14 +8,16 @@ You can manually install the root certs, but first you have to get them from som
    2. `cd curl/lib`
    3. edit `mk-ca-bundle.pl` and change:

    perl
    my $url = 'http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';

    ```perl
    my $url = 'http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';
    ```

    to

    perl
    my $url = 'https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';

    ```perl
    my $url = 'https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';
    ```

    (change `http` to `https`)
    4. `./mk-ca-bundle.pl`

  3. jjb revised this gist May 27, 2011. 1 changed file with 4 additions and 5 deletions.
    9 changes: 4 additions & 5 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -8,15 +8,14 @@ You can manually install the root certs, but first you have to get them from som
    2. `cd curl/lib`
    3. edit `mk-ca-bundle.pl` and change:

    ```perl
    perl
    my $url = 'http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';
    ```


    to

    ```perl
    perl
    my $url = 'https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';
    ```

    (change `http` to `https`)
    4. `./mk-ca-bundle.pl`

  4. jjb revised this gist May 27, 2011. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -8,12 +8,15 @@ You can manually install the root certs, but first you have to get them from som
    2. `cd curl/lib`
    3. edit `mk-ca-bundle.pl` and change:

    ```perl
    my $url = 'http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';
    ```

    to

    ```perl
    my $url = 'https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';

    ```
    (change `http` to `https`)
    4. `./mk-ca-bundle.pl`

  5. jjb revised this gist May 27, 2011. 1 changed file with 9 additions and 10 deletions.
    19 changes: 9 additions & 10 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -4,18 +4,17 @@ You can manually install the root certs, but first you have to get them from som

    **problem:** Sadly, ironically, and comically, it's not possible to access that file via https! Luckily, the awesome curl project does provide us with the script that they use to produce the file, so we can do it securely ourselves. Here's how.

    1. `git clone https://github.com/bagder/curl.git`
    2. `cd curl/lib`
    3. edit `mk-ca-bundle.pl` and change:
    1. `git clone https://github.com/bagder/curl.git`
    2. `cd curl/lib`
    3. edit `mk-ca-bundle.pl` and change:

    my $url = 'http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';
    my $url = 'http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';

    to
    to

    my $url = 'https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';
    my $url = 'https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';

    (change `http` to `https`)
    (change `http` to `https`)
    4. `./mk-ca-bundle.pl`

    4. `./mk-ca-bundle.pl`

    Ta da!
    Ta da!
  6. jjb revised this gist May 27, 2011. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -9,10 +9,13 @@ You can manually install the root certs, but first you have to get them from som
    3. edit `mk-ca-bundle.pl` and change:

    my $url = 'http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';

    to

    my $url = 'https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';

    (change `http` to `https`)

    4. `./mk-ca-bundle.pl`

    Ta da!
  7. jjb revised this gist May 27, 2011. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,7 @@ You can manually install the root certs, but first you have to get them from som
    1. `git clone https://github.com/bagder/curl.git`
    2. `cd curl/lib`
    3. edit `mk-ca-bundle.pl` and change:

    my $url = 'http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';
    to
    my $url = 'https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';
  8. jjb revised this gist May 27, 2011. 1 changed file with 14 additions and 2 deletions.
    16 changes: 14 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,17 @@
    If you want to use curl or open-uri to access https resources, you will often (always?) get an error, because they don't have the large number of root certificates installed that web browsers have.

    You can manually install the root certs, but first you have to get them from somewhere. [This article](http://notetoself.vrensk.com/2008/09/verified-https-in-ruby/) gives a nice description of how to do that. The source of the cert files it points to is hosted by the curl project, who kindly provide it in the .pem format.
    You can manually install the root certs, but first you have to get them from somewhere. [This article](http://notetoself.vrensk.com/2008/09/verified-https-in-ruby/) gives a nice description of how to do that. The [source of the cert files](http://curl.haxx.se/ca/cacert.pem) it points to is hosted by the curl project, who kindly provide it in the .pem format.

    **problem:** It's not possible
    **problem:** Sadly, ironically, and comically, it's not possible to access that file via https! Luckily, the awesome curl project does provide us with the script that they use to produce the file, so we can do it securely ourselves. Here's how.

    1. `git clone https://github.com/bagder/curl.git`
    2. `cd curl/lib`
    3. edit `mk-ca-bundle.pl` and change:
    my $url = 'http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';
    to
    my $url = 'https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1';

    (change `http` to `https`)
    4. `./mk-ca-bundle.pl`

    Ta da!
  9. jjb revised this gist May 27, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    If you want to use curl or open-uri to access https resources, you will often (always?) get an error, because they don't have the large number of root certificates installed that web browsers have.

    You can manually install the root certs, but first you have to get them from somewhere. (This article)[http://notetoself.vrensk.com/2008/09/verified-https-in-ruby/] gives a nice description of how to do that. The source of the cert files it points to is hosted by the curl project, who kindly provide it in the .pem format.
    You can manually install the root certs, but first you have to get them from somewhere. [This article](http://notetoself.vrensk.com/2008/09/verified-https-in-ruby/) gives a nice description of how to do that. The source of the cert files it points to is hosted by the curl project, who kindly provide it in the .pem format.

    **problem:** It's not possible
  10. jjb created this gist May 27, 2011.
    5 changes: 5 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    If you want to use curl or open-uri to access https resources, you will often (always?) get an error, because they don't have the large number of root certificates installed that web browsers have.

    You can manually install the root certs, but first you have to get them from somewhere. (This article)[http://notetoself.vrensk.com/2008/09/verified-https-in-ruby/] gives a nice description of how to do that. The source of the cert files it points to is hosted by the curl project, who kindly provide it in the .pem format.

    **problem:** It's not possible