{"action":"created","issue":{"url":"https://api.github.com/repos/diafygi/acme-tiny/issues/127","repository_url":"https://api.github.com/repos/diafygi/acme-tiny","labels_url":"https://api.github.com/repos/diafygi/acme-tiny/issues/127/labels{/name}","comments_url":"https://api.github.com/repos/diafygi/acme-tiny/issues/127/comments","events_url":"https://api.github.com/repos/diafygi/acme-tiny/issues/127/events","html_url":"https://github.com/diafygi/acme-tiny/pull/127","id":158035191,"number":127,"title":"Fetch and include intermediate cert(s), too.","user":{"login":"caldwell","id":45445,"avatar_url":"https://avatars.githubusercontent.com/u/45445?v=3","gravatar_id":"","url":"https://api.github.com/users/caldwell","html_url":"https://github.com/caldwell","followers_url":"https://api.github.com/users/caldwell/followers","following_url":"https://api.github.com/users/caldwell/following{/other_user}","gists_url":"https://api.github.com/users/caldwell/gists{/gist_id}","starred_url":"https://api.github.com/users/caldwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caldwell/subscriptions","organizations_url":"https://api.github.com/users/caldwell/orgs","repos_url":"https://api.github.com/users/caldwell/repos","events_url":"https://api.github.com/users/caldwell/events{/privacy}","received_events_url":"https://api.github.com/users/caldwell/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2016-06-02T00:21:22Z","updated_at":"2016-08-22T22:20:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/diafygi/acme-tiny/pulls/127","html_url":"https://github.com/diafygi/acme-tiny/pull/127","diff_url":"https://github.com/diafygi/acme-tiny/pull/127.diff","patch_url":"https://github.com/diafygi/acme-tiny/pull/127.patch"},"body":"As in be31020b3c063cc2605c16ca483b34fed81690e1, Let's Encrypt changed their intermediate. It turns out this is communicated in the ACME protocol, so we might as well do this automatically. This patch grabs the intermediates listed when retrieving the main cert and sticks everything together as a chained certificate.\r\n\r\nIntermediates are listed as `Link` response headers, where `rel=\"up\"`."},"comment":{"url":"https://api.github.com/repos/diafygi/acme-tiny/issues/comments/241569355","html_url":"https://github.com/diafygi/acme-tiny/pull/127#issuecomment-241569355","issue_url":"https://api.github.com/repos/diafygi/acme-tiny/issues/127","id":241569355,"user":{"login":"sdgathman","id":2164760,"avatar_url":"https://avatars.githubusercontent.com/u/2164760?v=3","gravatar_id":"","url":"https://api.github.com/users/sdgathman","html_url":"https://github.com/sdgathman","followers_url":"https://api.github.com/users/sdgathman/followers","following_url":"https://api.github.com/users/sdgathman/following{/other_user}","gists_url":"https://api.github.com/users/sdgathman/gists{/gist_id}","starred_url":"https://api.github.com/users/sdgathman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdgathman/subscriptions","organizations_url":"https://api.github.com/users/sdgathman/orgs","repos_url":"https://api.github.com/users/sdgathman/repos","events_url":"https://api.github.com/users/sdgathman/events{/privacy}","received_events_url":"https://api.github.com/users/sdgathman/received_events","type":"User","site_admin":false},"created_at":"2016-08-22T22:20:44Z","updated_at":"2016-08-22T22:20:44Z","body":"Here is another fix so the --chain patch works with python2.6.  \r\n```\r\n+++ ./acme_tiny.py\t2016-08-22 18:05:21.900847546 -0400\r\n@@ -160,12 +160,14 @@ def get_crt(account_key, csr, acme_dir,\r\n     if code != 201:\r\n         raise ValueError(\"Error signing certificate: {0} {1}\".format(code, result))\r\n \r\n-    def parse_link_header(line):\r\n-        m = re.search(r\"^Link:\\s*<([^>]*)>(?:\\s*;\\s*(.*))?\\r\\n$\", line)\r\n-        return (m.group(1), { a[0]: a[1].strip('\"') for a in [attr.split(\"=\") for attr in m.group(2).split(\"\\s*;\\s*\")] })\r\n-\r\n     certchain = [result]\r\n     if chain:\r\n+        def parse_link_header(line):\r\n+            m = re.search(r\"^Link:\\s*<([^>]*)>(?:\\s*;\\s*(.*))?\\r\\n$\", line)\r\n+            return (m.group(1), dict([(a[0],a[1].strip('\"'))\r\n+                for a in [attr.split(\"=\") \r\n+                    for attr in m.group(2).split(\"\\s*;\\s*\")]]))\r\n+\r\n         up = [\r\n           link for link, attr in [\r\n             parse_link_header(l) for l in headers.getallmatchingheaders(\"Link\")\r\n```"}}
{"actor":{"display_login":"sdgathman"}}