{"action":"created","issue":{"url":"https://api.github.com/repos/mholt/caddy/issues/579","repository_url":"https://api.github.com/repos/mholt/caddy","labels_url":"https://api.github.com/repos/mholt/caddy/issues/579/labels{/name}","comments_url":"https://api.github.com/repos/mholt/caddy/issues/579/comments","events_url":"https://api.github.com/repos/mholt/caddy/issues/579/events","html_url":"https://github.com/mholt/caddy/pull/579","id":131936250,"number":579,"title":"Fix crash when loading a certificate with no OCSP servers.","user":{"login":"chrismoos","id":175192,"avatar_url":"https://avatars.githubusercontent.com/u/175192?v=3","gravatar_id":"","url":"https://api.github.com/users/chrismoos","html_url":"https://github.com/chrismoos","followers_url":"https://api.github.com/users/chrismoos/followers","following_url":"https://api.github.com/users/chrismoos/following{/other_user}","gists_url":"https://api.github.com/users/chrismoos/gists{/gist_id}","starred_url":"https://api.github.com/users/chrismoos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrismoos/subscriptions","organizations_url":"https://api.github.com/users/chrismoos/orgs","repos_url":"https://api.github.com/users/chrismoos/repos","events_url":"https://api.github.com/users/chrismoos/events{/privacy}","received_events_url":"https://api.github.com/users/chrismoos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-07T05:15:53Z","updated_at":"2016-02-07T06:24:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mholt/caddy/pulls/579","html_url":"https://github.com/mholt/caddy/pull/579","diff_url":"https://github.com/mholt/caddy/pull/579.diff","patch_url":"https://github.com/mholt/caddy/pull/579.patch"},"body":"If a user-specified certificate does not have any OCSP servers then caddy crashes when trying to staple OCSP responses. The crash happens in the ACME library (in the ``GetOCSPForCert`` method) because it expects all certificates will have OCSP servers.\r\n\r\n```\r\nActivating privacy features...\r\npanic: runtime error: index out of range\r\n\r\ngoroutine 1 [running]:\r\ngithub.com/xenolf/lego/acme.GetOCSPForCert(0xc208034a00, 0x11bb, 0x13bb, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)\r\n        /home/caddy/go/src/github.com/xenolf/lego/acme/crypto.go:100 +0xb61\r\ngithub.com/mholt/caddy/caddy/letsencrypt.StapleOCSP(0xc2080bc580, 0x1, 0x1, 0x0, 0x0)\r\n        /tmp/custombuild_5606_232318014/src/github.com/mholt/caddy/caddy/letsencrypt/letsencrypt.go:216 +0x2d5\r\ngithub.com/mholt/caddy/caddy/letsencrypt.Activate(0xc2080bc580, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)\r\n        /tmp/custombuild_5606_232318014/src/github.com/mholt/caddy/caddy/letsencrypt/letsencrypt.go:67 +0x165\r\ngithub.com/mholt/caddy/caddy.loadConfigs(0x7ffeb40adf7c, 0x9, 0x7fbc7678cf80, 0xc2080e42a0, 0x0, 0x0, 0x0, 0x0, 0x0)\r\n        /tmp/custombuild_5606_232318014/src/github.com/mholt/caddy/caddy/config.go:131 +0x281\r\ngithub.com/mholt/caddy/caddy.Start(0x7fbc7678d418, 0xc2080e4270, 0x0, 0x0)\r\n        /tmp/custombuild_5606_232318014/src/github.com/mholt/caddy/caddy/caddy.go:139 +0x2c3\r\nmain.main()\r\n        /tmp/custombuild_5606_232318014/src/github.com/mholt/caddy/main.go:101 +0x61a\r\n```"},"comment":{"url":"https://api.github.com/repos/mholt/caddy/issues/comments/180961976","html_url":"https://github.com/mholt/caddy/pull/579#issuecomment-180961976","issue_url":"https://api.github.com/repos/mholt/caddy/issues/579","id":180961976,"user":{"login":"chrismoos","id":175192,"avatar_url":"https://avatars.githubusercontent.com/u/175192?v=3","gravatar_id":"","url":"https://api.github.com/users/chrismoos","html_url":"https://github.com/chrismoos","followers_url":"https://api.github.com/users/chrismoos/followers","following_url":"https://api.github.com/users/chrismoos/following{/other_user}","gists_url":"https://api.github.com/users/chrismoos/gists{/gist_id}","starred_url":"https://api.github.com/users/chrismoos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrismoos/subscriptions","organizations_url":"https://api.github.com/users/chrismoos/orgs","repos_url":"https://api.github.com/users/chrismoos/repos","events_url":"https://api.github.com/users/chrismoos/events{/privacy}","received_events_url":"https://api.github.com/users/chrismoos/received_events","type":"User","site_admin":false},"created_at":"2016-02-07T06:24:35Z","updated_at":"2016-02-07T06:24:35Z","body":"@mholt I was thinking it might be better to fix it there...sent a PR: https://github.com/xenolf/lego/pull/104"}}