{"action":"created","issue":{"url":"https://api.github.com/repos/mholt/caddy/issues/2400","repository_url":"https://api.github.com/repos/mholt/caddy","labels_url":"https://api.github.com/repos/mholt/caddy/issues/2400/labels{/name}","comments_url":"https://api.github.com/repos/mholt/caddy/issues/2400/comments","events_url":"https://api.github.com/repos/mholt/caddy/issues/2400/events","html_url":"https://github.com/mholt/caddy/issues/2400","id":392991411,"node_id":"MDU6SXNzdWUzOTI5OTE0MTE=","number":2400,"title":"Caddy produces account rate limit errors when compiled with latest certmagic package","user":{"login":"whalehub","id":44198148,"node_id":"MDQ6VXNlcjQ0MTk4MTQ4","avatar_url":"https://avatars2.githubusercontent.com/u/44198148?v=4","gravatar_id":"","url":"https://api.github.com/users/whalehub","html_url":"https://github.com/whalehub","followers_url":"https://api.github.com/users/whalehub/followers","following_url":"https://api.github.com/users/whalehub/following{/other_user}","gists_url":"https://api.github.com/users/whalehub/gists{/gist_id}","starred_url":"https://api.github.com/users/whalehub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whalehub/subscriptions","organizations_url":"https://api.github.com/users/whalehub/orgs","repos_url":"https://api.github.com/users/whalehub/repos","events_url":"https://api.github.com/users/whalehub/events{/privacy}","received_events_url":"https://api.github.com/users/whalehub/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-20T10:53:51Z","updated_at":"2018-12-20T10:57:07Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nAre you asking for help with using Caddy? Please use our forum instead: https://caddy.community. If you are filing a bug report, please take a few minutes to carefully answer the following questions. If your issue is not a bug report, you do not need to use this template. Thanks!)\r\n-->\r\n\r\n### 1. What version of Caddy are you using (`caddy -version`)?\r\n\r\nWorking build: Caddy 0.11.1 (+0684cf8 Wed Dec 19 15:48:39 UTC 2018) (unofficial)\r\nBroken build: Caddy 0.11.1 (+0b83014 Thu Dec 20 10:24:39 UTC 2018) (unofficial)\r\n\r\n### 2. What are you trying to do?\r\n\r\nI'm trying to run a build of Caddy that has been compiled against the [latest commit](https://github.com/mholt/caddy/commit/0b83014ff81b68b8fde21521662339396c277ab8).\r\n\r\n### 3. What is your entire Caddyfile?\r\n\r\n```\r\n(headers) {\r\n\r\n   header / {\r\n        Strict-Transport-Security \"max-age=31536000; includeSubDomains; preload\"\r\n        X-XSS-Protection \"1; mode=block\"\r\n        X-Content-Type-Options \"nosniff\"\r\n        X-Frame-Options \"sameorigin\"\r\n        Referrer-Policy \"same-origin\"\r\n        Expect-CT \"max-age=86400, enforce, report-uri=\\\"<redacted>\"\"\r\n        Feature-Policy \"geolocation 'none'; camera 'none'; microphone 'none'\"\r\n        Content-Security-Policy \"\r\n          default-src 'none' ;\r\n          script-src 'self' \r\n            'sha256-cecXKP7KMOZMsFpYnnSCvdcCU6aS02wUdHhXQz+rzBY=' \r\n            'sha256-/7v/RBsCYSwEKfNm3GKddoMHIwFQ+LfJpRWy80yIag4=' ;\r\n          style-src 'self' \r\n            'sha256-PNU+0KaVWZj7tiWyHGw3pEsZuO7kRmnu5/l6YGevQT8=' \r\n            'sha256-aqNNdDLnnrDOnTNdkJpYlAxKVJtLt9CtFLklmInuUAE=' \r\n            'sha256-JzqfVewwP10gJQP4wR5aRX/QBEDQqm4aNzeNDSlmFMA=' \r\n            'sha256-6HXkwoFqJhqd+PP4Vxf73UzS42TYUDqU+itLbeA5gkg=' \r\n            'sha256-xU719XNBJeO/eH/EjSQB+kSzlP6mmB8IQMtMQXFyp+o=' \r\n            'sha256-aIzxslm0qrBPPo+5scCOmx10sNTFpcpSd4f3MmyjjFM=' \r\n            'sha256-H8+aYwf/B0lGGDHV2VNReccOGfuYjzG52CWxEhAPqJs=' ;\r\n          img-src * ;\r\n          font-src 'self' data: ; \r\n          connect-src 'self' data: ; \r\n          media-src 'self' data: ; \r\n          object-src 'none' ; \r\n          worker-src 'self' ; \r\n          manifest-src 'self' ; \r\n          frame-ancestors 'self' ; \r\n          form-action 'self' ; \r\n          upgrade-insecure-requests ; \r\n          block-all-mixed-content ; \r\n          report-uri <redacted>;\"\r\n        -Server\r\n    }\r\n}\r\n\r\n(ecc-tls-wildcard) {\r\n\r\n   tls {\r\n       protocols tls1.2 tls1.3\r\n       dns gandiv5\r\n\t   ciphers ECDHE-ECDSA-AES128-GCM-SHA256 TLS13-AES-128-GCM-SHA256 ECDHE-ECDSA-WITH-CHACHA20-POLY1305 TLS13-CHACHA20-POLY1305-SHA256 ECDHE-ECDSA-AES256-GCM-SHA384 TLS13-AES-256-GCM-SHA384\r\n\t   key_type\tp384\r\n\t   must_staple\r\n\t   wildcard\r\n    }\r\n}\r\n\r\n(whitelist) {\r\n\r\n   ipfilter / {\r\n\t   rule allow\r\n\t   ip <redacted>\r\n    }\r\n}\r\n\r\nredacted.domain.tld {\r\n\r\n   proxy / <redacted> {\r\n       transparent\r\n       websocket\r\n    }\r\n\r\n   import headers\r\n   import ecc-tls-wildcard\r\n   import whitelist\r\n}\r\n```\r\n\r\n### 4. How did you run Caddy (give the full command and describe the execution environment)?\r\n\r\nI'm running Caddy on Debian 9.6 with this command:\r\n\r\n```\r\ncaddy -agree -http2 -log /opt/caddy/log -root /opt/caddy/webroot -conf /opt/caddy/Caddyfile\r\n```\r\n\r\n### 5. Please paste any relevant HTTP request(s) here.\r\n\r\nN/A\r\n\r\n### 6. What did you expect to see?\r\n\r\nI expect Caddy to either:\r\n\r\na.) use the existing account in my .caddy folder to fetch certificates or \r\nb.) successfully register a new account in case none exist in the .caddy folder.\r\n\r\n### 7. What did you see instead (give full error messages and/or log)?\r\n\r\nCaddy ignores any existing accounts in the .caddy folder and will always try to register a new account. When trying to register a new account, Caddy produces a rate limit error despite it being the the first registration attempt within 24 hours (i.e., it's not actually hitting LetsEncrypt's \"[10 registrations per 3 hours](https://letsencrypt.org/docs/rate-limits/)\" rate limit).\r\n\r\nHere's the output from the log file:\r\n\r\n```\r\nActivating privacy features...\r\n\r\nYour sites will be served over HTTPS automatically using Let's Encrypt.\r\nBy continuing, you agree to the Let's Encrypt Subscriber Agreement at:\r\n  https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf\r\nPlease enter your email address to signify agreement and to be notified\r\nin case of issues. You can leave it blank, but we don't recommend it.\r\n  Email address:\r\n2018/12/20 11:36:53 registration error: acme: error: 429 :: POST :: https://acme-v02.api.letsencrypt.org/acme/new-acct :: urn:ietf:params:acme:error:rateLimited :: Error creating new account :: too many registrations for this IP: see https://letsencrypt.org/docs/rate-limits/, url:\r\n```\r\n\r\n**Note:** This problem does not occur when you use a build of Caddy that has been compiled against the [second latest commit](https://github.com/mholt/caddy/commit/0684cf861170a112a041137b352322602543ccdf). That build of Caddy can both use existing accounts in the .caddy folder as well as register a new account in case none are present in the .caddy folder.\r\n\r\n### 8. How can someone who is starting from scratch reproduce the bug as minimally as possible?\r\n\r\n1. Install Go.\r\n2. Compile Caddy against the master branch with the following command:\r\n\r\n```\r\ngo get github.com/mholt/caddy/caddy && \\\r\ngo get github.com/caddyserver/builds && \\\r\ncd $GOPATH/src/github.com/mholt/caddy/caddy && \\\r\ngo run build.go\r\n```\r\n\r\n2. Run Caddy with the following command:\r\n\r\n```\r\ncaddy -agree -http2 -log /opt/caddy/log -root /opt/caddy/webroot -conf /opt/caddy/Caddyfile\r\n```"},"comment":{"url":"https://api.github.com/repos/mholt/caddy/issues/comments/448956589","html_url":"https://github.com/mholt/caddy/issues/2400#issuecomment-448956589","issue_url":"https://api.github.com/repos/mholt/caddy/issues/2400","id":448956589,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODk1NjU4OQ==","user":{"login":"whalehub","id":44198148,"node_id":"MDQ6VXNlcjQ0MTk4MTQ4","avatar_url":"https://avatars2.githubusercontent.com/u/44198148?v=4","gravatar_id":"","url":"https://api.github.com/users/whalehub","html_url":"https://github.com/whalehub","followers_url":"https://api.github.com/users/whalehub/followers","following_url":"https://api.github.com/users/whalehub/following{/other_user}","gists_url":"https://api.github.com/users/whalehub/gists{/gist_id}","starred_url":"https://api.github.com/users/whalehub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whalehub/subscriptions","organizations_url":"https://api.github.com/users/whalehub/orgs","repos_url":"https://api.github.com/users/whalehub/repos","events_url":"https://api.github.com/users/whalehub/events{/privacy}","received_events_url":"https://api.github.com/users/whalehub/received_events","type":"User","site_admin":false},"created_at":"2018-12-20T10:57:07Z","updated_at":"2018-12-20T10:57:07Z","author_association":"NONE","body":"@mholt What are your thoughts on the issue?"}}
{"actor":{"display_login":"whalehub"}}