Skip to content

Fix HTTP status code for various errors #115

Closed

Description

@jsha

Right now NewAuthorization in WFE will return 500 for a bogus name like "foo.zom," with the problem document indicating the identifier doesn't end in a public suffix. This should return 403 instead.

More generally we should figure out how backends can indicate to WFE the difference between forbidden and server failure. Right now everything is just returned as an error.

Activity

  1. added this to the Deployment milestone on Apr 29, 2015
  2. changed the title [-]Fix HTTP status code for "doesn't end in public suffix"[/-] [+]Fix HTTP status code for various errors[/+] on May 6, 2015
  3. jsha commented on May 6, 2015

    @jsha
    ContributorAuthor

    One good way to do this would be to define types that implement Error, e.g.

    type NotFoundError int
    type ForbiddenError int
    
    func (*n NotFoundError) Error() string {
      return "Not found"
    }
    

    In sendError we would to type assertions (er, ok = err.(NotFoundError); if ok {) to check if the error was one of these, and respond with the right error code. Otherwise we'd respond with 500. So any error that bubbles up that was not specifically tagged as an HTTP error would be a 500. We should monitor 500s and aim to never serve them: Any expected error case should be assigned a non-500 HTTP status code.

  4. diracdeltas commented on May 7, 2015

    @diracdeltas

    Is this possibly related to the error I'm seeing in certbot/certbot#387 when asking for a cert for "foo.icann.wtf"? note that wtf is a valid ICANN suffix :). I am getting a 502 response when POSTing to https://www.letsencrypt-demo.org/acme/new-authz.

  5. jsha commented on May 7, 2015

    @jsha
    ContributorAuthor

    Nope, wtf is in the version of the PSL we are using. It looks like the demo server got rebooted recently so Boulder wasn't running, thus the 502. I just started it; try again?

  6. diracdeltas commented on May 7, 2015

    @diracdeltas

    Works now, thanks.

  7. kuba commented on May 7, 2015

    @kuba
    Contributor

    this is somewhat related to #128

  8. jsha commented on May 19, 2015

    @jsha
    ContributorAuthor

    Actually, the necessary error types already exist in core/util.go:

    type NotSupportedError string
    type MalformedRequestError string
    type UnauthorizedError string
    type NotFoundError string
    

    So we should use those where appropriate.

  9. self-assigned this
    on May 26, 2015
  10. assigned and unassigned on Jun 1, 2015
  11. bdaehlie commented on Jun 1, 2015

    @bdaehlie

    I believe this is resolved now that pull request #272 has merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions