Re: [Acme] ACME breaking change: Most GETs become POSTs

Richard Barnes <rlb@ipv.sx> Fri, 31 August 2018 21:27 UTC

Return-Path: <rlb@ipv.sx>
X-Original-To: acme@ietfa.amsl.com
Delivered-To: acme@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 384C2130E65 for <acme@ietfa.amsl.com>; Fri, 31 Aug 2018 14:27:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.909
X-Spam-Level:
X-Spam-Status: No, score=-1.909 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, T_DKIMWL_WL_MED=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=ipv-sx.20150623.gappssmtp.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CQ9n5cqUN85r for <acme@ietfa.amsl.com>; Fri, 31 Aug 2018 14:26:58 -0700 (PDT)
Received: from mail-oi0-x231.google.com (mail-oi0-x231.google.com [IPv6:2607:f8b0:4003:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id ADF31130E1D for <acme@ietf.org>; Fri, 31 Aug 2018 14:26:58 -0700 (PDT)
Received: by mail-oi0-x231.google.com with SMTP id 13-v6so24195558ois.1 for <acme@ietf.org>; Fri, 31 Aug 2018 14:26:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipv-sx.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=p5F1ekh26aLHVIHQuUbw8j/pDpy9UPm0lWvCXUYwTCA=; b=zToZoi06g1j9iISUZ3b39/eIx4uFUMj7UKdATrVux6JLqsawv+dyB2kNpDpAj61J81 iWfdfDuGQK3lgGkVVmM9+fvhrblcIDbSfiSUOf3KOzpovt+/EuN74H1a1vmomJ0GodkP W2smeG3h+Chb/ygHv75ddWkgoIKwjb/OmCNTDmEXbZL19do0i+dmgZThjCQ2rvMo+gxU +zGf2smLDo4mdp9DTQ4IxQLUBP/beYwuMFuqWM9Ykd++Mepv8crpdPwir4fqGK9bVVIo 6tw+5bvYpkDz1UHu4FmFVg80P+s1PoldQOS6Qr5c4X8u7JmH52xLrbQozVeb46bCf1fl 7QvA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=p5F1ekh26aLHVIHQuUbw8j/pDpy9UPm0lWvCXUYwTCA=; b=CJBUiysjTGOxjUV6H6b4R0SUR/D2loy+CdWUuEZJe6efs2xPIVEdPKdWZPC2l3t4bU A8wOgWJ6oowVZpWuPsfcQUuawmalOpu8OcvWayxpCKyK8O0HKcDBlXFir9Q0cGiuYNSG MYLIQ9cWKkRX+RnKIWHwTxmS3DLpwBSgsShdHJCEMc5tgOpPVgUs6tIqfgEv3hZTZ5nJ TaFRPphRdoIImb6acZU8uUfDbZQQm7oHalpO3urv6T/ro24JHei2U1JAN30n6LQqOMxR rhAspD7CaKnJ8I2d5HScikJcPANnz7rhs4Cy26ESLd8e+0NJuAFyDE9tiuY2fttgZPXl GQJA==
X-Gm-Message-State: APzg51AVZY2OteeLci3CtbZkp6sxd1yogT50ksZioXLDtyk+RhEtPYbo ALqG5cXBsEWREMYYKC+5ipf7E3WbZQ3i6MAFTMbbcg==
X-Google-Smtp-Source: ANB0Vdb/JX9IhnpLpwrQLGS6nhm8itp8AemyeM0ZjmbfAkF/fsSTSmQUXVD8ZLpB045P8+24eQMzzswTmJspOEwm9Y8=
X-Received: by 2002:aca:3c45:: with SMTP id j66-v6mr8758517oia.118.1535750816667; Fri, 31 Aug 2018 14:26:56 -0700 (PDT)
MIME-Version: 1.0
References: <c33184f3-4e64-b7ea-babb-d29e2307f1f3@eff.org> <CAL02cgRD=UgsaDeWN9hy2YXN=CLLQpt+zgaZKPTqDpoiMi0hqw@mail.gmail.com> <863A4A5E-718A-4C29-AE82-097C70BE75B6@akamai.com> <CAL02cgQ=FjSLYuzKMnkbVHqPaU7A1sc5xSCk6dWa67=1a3b3vw@mail.gmail.com> <CAKnbcLhiGSKqmd5Hq3fn3YOwDCQfDa7XW0YuzK4FgmxAKZ+XWA@mail.gmail.com> <CAKnbcLhmOmR53_qTGand5JM_ugNsSYGw3bxV3q91WmV1uf7jSw@mail.gmail.com>
In-Reply-To: <CAKnbcLhmOmR53_qTGand5JM_ugNsSYGw3bxV3q91WmV1uf7jSw@mail.gmail.com>
From: Richard Barnes <rlb@ipv.sx>
Date: Fri, 31 Aug 2018 17:26:44 -0400
Message-ID: <CAL02cgT2k7=0xjiXovuJK4ETQSGDrt9i6ET9PXeE21WFmLTMNw@mail.gmail.com>
To: Daniel McCarney <cpu@letsencrypt.org>
Cc: "Salz, Rich" <rsalz@akamai.com>, IETF ACME <acme@ietf.org>, Jacob Hoffman-Andrews <jsha@eff.org>
Content-Type: multipart/alternative; boundary="000000000000e42de00574c1d956"
Archived-At: <https://mailarchive.ietf.org/arch/msg/acme/ibr49xb_U80xiwdoFikdaBoqgYg>
Subject: Re: [Acme] ACME breaking change: Most GETs become POSTs
X-BeenThere: acme@ietf.org
X-Mailman-Version: 2.1.27
Precedence: list
List-Id: Automated Certificate Management Environment <acme.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/acme>, <mailto:acme-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/acme/>
List-Post: <mailto:acme@ietf.org>
List-Help: <mailto:acme-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/acme>, <mailto:acme-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 31 Aug 2018 21:27:01 -0000

On Fri, Aug 31, 2018 at 3:30 PM Daniel McCarney <cpu@letsencrypt.org> wrote:

> here's a PR[0] for the Pebble ACME server that implements Richard's
>> proposal[1] to establish viability. The proposal seems OK to me given
>> the trade-offs/alternatives on the table.
>
>
> One of the changes Richard made in his second iteration of PR #445 was to
> differentiate a POST from a POST-as-GET by sending an empty body "a
> zero-length octet string" in the POST JWS. Talking about the experience of
> implementing this more with Jacob Hoffman-Andrews I think I've come around
> to preferring an alternative design. #445 as described requires server and
> client developers pay careful attention to the differences between `null`
> and `""` in serialization/deserialization and might be bumping into
> differences between languages/JSON parsers. Both myself and Jacob failed to
> get it right on a first-go[0] and if people this close to the specification
> are going to trip on this I think we can be assured others will too.
>
> A proposed alternative: We use `{}` as the body for POST-as-GET (as
> suggested by Jacob[1]) and further specify that challenges can only be
> initiated with a POST and do not support POST-as-GET.
>
> Using `{}` as the body matches the long standing method of authenticating
> access to account information and avoids any null troubles. Removing
> polling of challenges is required to free up POSTing `{}` as the challenge
> initiation message. All of the challenge information is already accessible
> by POST-as-GET polling the associated authorization and it seems sensible
> to remove that redundancy as it can cause bugs when a client developer
> polls a challenge for an authorization not realizing the associated
> authorization has changed to status valid from a different challenge.
>
> Thoughts?
>

The confusion over `null` and `""` is actually part of the motivation for
using a zero-length body -- it's not JSON.   That's what makes it a good
signal.  If you're doing POST-as-POST, you have a JSON body and you have to
do JSON stuff.  If you're doing POST-as-GET, you're not and you don't.  It
guarantees clean separation between the two cases, minimizing risk of
confusion.

I think the cleaner answer here is to fix the "account fetch" case to use
POST-as-GET.

--Richard



>
> [0] https://github.com/letsencrypt/pebble/pull/162#discussion_r214446189
> [1] https://github.com/ietf-wg-acme/acme/pull/445#issuecomment-417505743
>
> On Fri, Aug 31, 2018 at 2:56 PM, Daniel McCarney <cpu@letsencrypt.org>
> wrote:
>
>> I think its an anti-pattern to standardize protocol features that haven't
>> been implemented by anyone so here's a PR[0] for the Pebble ACME server
>> that implements Richard's proposal[1] to establish viability. The proposal seems
>> OK to me given the trade-offs/alternatives on the table.
>>
>> I would encourage other ACME client/server developers to try their hand
>> at implementing the changes from [1] as well. I've tested my PR with
>> hand-rolled requests but not as part of an automated issuance process with
>> a "real" ACME client. Speak now or forever hold your bugs.
>>
>> [0] - https://github.com/letsencrypt/pebble/pull/162
>> [1] - https://github.com/ietf-wg-acme/acme/pull/445/files
>>
>> On Fri, Aug 31, 2018 at 1:21 PM, Richard Barnes <rlb@ipv.sx> wrote:
>>
>>> No, if a server receives a GET request for a resource other than those
>>> specified, then it MUST return 405.  But please check out the PR and see if
>>> it's clear there.
>>>
>>> On Fri, Aug 31, 2018 at 1:14 PM Salz, Rich <rsalz@akamai.com> wrote:
>>>
>>>>
>>>>    - * Servers MUST return a 405 if they get a GET for a resource
>>>>    other than directory/newNonce/certificate.
>>>>
>>>>
>>>>
>>>> They means client? Or there’s a word missing, and “they get a” is “they
>>>> do not support”
>>>>
>>>
>>> _______________________________________________
>>> Acme mailing list
>>> Acme@ietf.org
>>> https://www.ietf.org/mailman/listinfo/acme
>>>
>>>
>>
>