Skip to content

Don't check for nonces on 5xx responses #521

Closed

Description

@jonathannoah

The issue I was having at #503 (Error creating new authz) looks to be resolved, but now every time I try to run letsencrypt, I get the following:

$ sudo ./venv/bin/letsencrypt -d jn1.me auth
Traceback (most recent call last):
      File "./venv/bin/letsencrypt", line 9, in <module>
        load_entry_point('letsencrypt==0.1', 'console_scripts', 'letsencrypt')()
      File "/home/deploy/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/letsencrypt/cli.py", line 406, in main
        return args.func(args, config, plugins)
      File "/home/deploy/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/letsencrypt/cli.py", line 133, in auth
        plugins):
      File "/home/deploy/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/letsencrypt/client.py", line 206, in obtain_and_enroll_certificate
        cert, privkey, chain = self.obtain_certificate(domains, csr)
      File "/home/deploy/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/letsencrypt/client.py", line 154, in obtain_certificate
        authzr = self.auth_handler.get_authorizations(domains)
      File "/home/deploy/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/letsencrypt/auth_handler.py", line 69, in get_authorizations
        domain, self.account.new_authzr_uri)
      File "/home/deploy/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/letsencrypt/network2.py", line 333, in request_domain_challenges
        typ=messages2.IDENTIFIER_FQDN, value=domain), new_authz_uri)
      File "/home/deploy/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/letsencrypt/network2.py", line 314, in request_challenges
        response = self._post(new_authzr_uri, new_authz)
      File "/home/deploy/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/letsencrypt/network2.py", line 178, in _post
        self._add_nonce(response)
      File "/home/deploy/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/letsencrypt/network2.py", line 149, in _add_nonce
        response.request.method))
    letsencrypt.errors.NetworkError: Server POST response did not include a replay nonce

Deleting my /etc/letsencrypt/accounts/ doesn't help, nor does removing and reinstalling letsencrypt. I noticed that the response to dig jn1.me -t TYPE257 @lucy.ns.cloudflare.com is the same "REFUSED" status as before; could that be the reason?

Activity

  1. davidar commented on Jun 20, 2015

    @davidar

    I'm seeing the same problem.

  2. kuba commented on Jun 20, 2015

    @kuba
    Contributor

    Are you running latest master, i.e. 99ff33e?

  3. davidar commented on Jun 20, 2015

    @davidar

    Yes.

  4. kuba commented on Jun 20, 2015

    @kuba
    Contributor

    There are 2 problems:

    1. Server is currently broken, see serverInternal :: The server experienced an internal error :: Error creating new authz #503 (comment). @jcjones, @jsha PTAL
    2. Client tries to retrieve the nonce without noticing HTTP 500 error code first. I will fix this bug today.

    Thanks for all reports. Managed to pin it down thanks to @GabLeRoux. To anyone else, next time please join #letsencrypt@Freenode to aid in debugging and in order to get quicker help. :)

  5. added a commit that references this issue on Jun 20, 2015
    04e9340
  6. jonathannoah commented on Jun 22, 2015

    @jonathannoah
    Author

    Is the server still broken? I receive the same "Maintenance Time" response as @GabLeRoux's #503 comment when I run with -vvvvvv.

    I'm Joe5150 in IRC, btw, so you can chat with me there if you need my help.

  7. kuba commented on Jun 22, 2015

    @kuba
    Contributor

    @davidar Are you using CloudFlare DNS as well?

    For everyone using CloudFlare: letsencrypt/boulder#391

  8. davidar commented on Jun 25, 2015

    @davidar

    @kuba Yes. Thanks, I'll follow that bug.

  9. added a commit that references this issue on Jul 3, 2015
    4407210
  10. GabLeRoux commented on Jul 7, 2015

    @GabLeRoux

    I confirm I am not getting this error message anymore (showing #503 again, but that's probably normal) Thanks :)

  11. Shadok commented on May 16, 2016

    @Shadok

    Sorry to reopen that case but i'm not using CloudFlare and i'm getting this error (i just cloned the repository, i was still using the old letsencrypt client before, so i'm up-to-date).

    2016-05-16 10:01:11,992:DEBUG:certbot.main:Arguments: ['--manual', '--renew-by-default', ' ....
    2016-05-16 10:01:11,992:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#apache,PluginEntryPoint#webroot,PluginEntryPoint#null,PluginEntryPoint#manual,PluginEntryPoint#standalone)
    2016-05-16 10:01:11,995:DEBUG:certbot.plugins.selection:Requested authenticator manual and installer None
    2016-05-16 10:01:11,999:DEBUG:certbot.plugins.selection:Single candidate plugin: * manual
    Description: Manually configure an HTTP server
    Interfaces: IAuthenticator, IPlugin
    Entry point: manual = certbot.plugins.manual:Authenticator
    Initialized: <certbot.plugins.manual.Authenticator object at 0x7fea23234050>
    Prep: True
    2016-05-16 10:01:12,000:DEBUG:certbot.plugins.selection:Selected authenticator <certbot.plugins.manual.Authenticator object at 0x7fea23234050> and installer None
    2016-05-16 10:01:12,020:DEBUG:certbot.main:Picked account: <Account(b56df047775afaaa30793681b6814f7a)>
    2016-05-16 10:01:12,021:DEBUG:root:Sending GET request to https://acme-v01.api.letsencrypt.org/directory. args: (), kwargs: {}
    2016-05-16 10:01:12,024:INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
    2016-05-16 10:01:12,308:DEBUG:requests.packages.urllib3.connectionpool:"GET /directory HTTP/1.1" 200 263
    2016-05-16 10:01:12,309:DEBUG:root:Received <Response [200]>. Headers: {'Content-Length': '263', 'Expires': 'Mon, 16 May 2016 10:01:27 GMT', 'Strict-Transport-Security': 'max-age=604800', 'Server': 'nginx', 'Connection': 'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'max-age=0, no-cache, no-store', 'Date': 'Mon, 16 May 2016 10:01:27 GMT', 'X-Frame-Options': 'DENY', 'Content-Type': 'application/json', 'Replay-Nonce': 'puBQFbC5S2vJZTbj2ksTq8ny-rt3Sk9HT7yM37Ungw4'}.
    Content: '{"new-authz":"https://acme-v01.api.letsencrypt.org/acme/new-authz","new-cert":"https://acme-v01.api.letsencrypt.org/acme/new-cert","new-reg":"https://acme-v01.api.letsencrypt.org/acme/new-reg","revoke-cert":"https://acme-v01.api.letsencrypt.org/acme/revoke-cert"}'
    2016-05-16 10:01:12,309:DEBUG:acme.client:Received response <Response [200]> (headers: {'Content-Length': '263', 'Expires': 'Mon, 16 May 2016 10:01:27 GMT', 'Strict-Transport-Security': 'max-age=604800', 'Server': 'nginx', 'Connection':'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'max-age=0, no-cache, no-store', 'Date': 'Mon, 16 May 2016 10:01:27 GMT', 'X-Frame-Options': 'DENY', 'Content-Type': 'application/json', 'Replay-Nonce': 'puBQFbC5S2vJZTbj2ksTq8ny-rt3Sk9HT7yM37Ungw4'}): '{"new-authz":"https://acme-v01.api.letsencrypt.org/acme/new-authz","new-cert":"https://acme-v01.api.letsencrypt.org/acme/new-cert","new-reg":"https://acme-v01.api.letsencrypt.org/acme/new-reg","revoke-cert":"https://acme-v01.api.letsencrypt.org/acme/revoke-cert"}'
    2016-05-16 10:01:12,325:DEBUG:root:Requesting fresh nonce
    2016-05-16 10:01:12,325:DEBUG:root:Sending HEAD request to https://acme-v01.api.letsencrypt.org/acme/new-authz. args: (), kwargs: {}
    2016-05-16 10:01:12,326:INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
    2016-05-16 10:01:49,254:DEBUG:requests.packages.urllib3.connectionpool:"HEAD /acme/new-authz HTTP/1.1" 503 0
    2016-05-16 10:01:49,255:DEBUG:root:Received <Response [503]>. Headers: {'Content-Length': '175', 'Expires': 'Mon, 16 May 2016 10:02:04 GMT', 'Server': 'AkamaiGHost', 'Connection': 'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'max-age=0, no-cache, no-store', 'Date': 'Mon, 16 May 2016 10:02:04 GMT', 'Content-Type': 'text/html', 'Mime-Version': '1.0'}. Content: ''2016-05-16 10:01:49,256:DEBUG:certbot.main:Exiting abnormally:
    Traceback (most recent call last):
      File "/root/.local/share/letsencrypt/bin/letsencrypt", line 11, in <module>
        sys.exit(main())
      File "/root/.local/share/letsencrypt/lib/python2.7/site-packages/certbot/main.py", line 693, in main
        return config.func(config, plugins)
      File "/root/.local/share/letsencrypt/lib/python2.7/site-packages/certbot/main.py", line 509, in obtain_cert
        _, action = _auth_from_domains(le_client, config, domains, lineage)
      File "/root/.local/share/letsencrypt/lib/python2.7/site-packages/certbot/main.py", line 90, in _auth_from_domains
        renewal.renew_cert(config, domains, le_client, lineage)
      File "/root/.local/share/letsencrypt/lib/python2.7/site-packages/certbot/renewal.py", line 236, in renew_cert
        new_certr, new_chain, new_key, _ = le_client.obtain_certificate(domains)
      File "/root/.local/share/letsencrypt/lib/python2.7/site-packages/certbot/client.py", line 246, in obtain_certificate
        self.config.allow_subset_of_names)
      File "/root/.local/share/letsencrypt/lib/python2.7/site-packages/certbot/auth_handler.py", line 64, in get_authorizations
        domain, self.account.regr.new_authzr_uri)
      File "/root/.local/share/letsencrypt/lib/python2.7/site-packages/acme/client.py", line 217, in request_domain_challenges
        typ=messages.IDENTIFIER_FQDN, value=domain), new_authzr_uri)
      File "/root/.local/share/letsencrypt/lib/python2.7/site-packages/acme/client.py", line 197, in request_challenges
        new_authz)
      File "/root/.local/share/letsencrypt/lib/python2.7/site-packages/acme/client.py", line 649, in post
        data = self._wrap_in_jws(obj, self._get_nonce(url))
      File "/root/.local/share/letsencrypt/lib/python2.7/site-packages/acme/client.py", line 644, in _get_nonce
        self._add_nonce(self.head(url))
      File "/root/.local/share/letsencrypt/lib/python2.7/site-packages/acme/client.py", line 639, in _add_nonce
        raise errors.MissingNonce(response)
    MissingNonce: Server HEAD response did not include a replay nonce, headers: {'Content-Length': '175', 'Expires': 'Mon, 16 May 2016 10:02:04 GMT', 'Server': 'AkamaiGHost', 'Connection': 'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'max-age=0, no-cache, no-store', 'Date': 'Mon, 16 May 2016 10:02:04 GMT', 'Content-Type': 'text/html', 'Mime-Version': '1.0'}
    
  12. Shadok commented on May 16, 2016

    @Shadok

    It worked on the second try.

  13. jsha commented on May 16, 2016

    @jsha
    Contributor

    @kuba: Looks like you had a fix for this going (kuba@04e9340), but it doesn't appear to be merged. Could you finish it up and post for review?

  14. changed the title [-]Server POST response did not include a replay nonce[/-] [+]Don't check for nonces on 5xx responses[/+] on May 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions