acme-client not complient with RFC 8555

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

acme-client not complient with RFC 8555

Wolf
Hello,
currently openbsd's acme-client breaks RFC 8555 section 6.1, in
particular sentence

> ACME clients MUST send a User-Agent header field, in accordance with
> [RFC7231].

Following patch corrects that:

--- a/http.c
+++ b/http.c
@@ -344,18 +344,21 @@ http_open(const struct http *http, int h
                        c = asprintf(&req,
                            "HEAD %s HTTP/1.0\r\n"
                            "Host: %s\r\n"
+                           "User-Agent: openbsd-acme-client\r\n"
                            "\r\n",
                            http->path, http->host);
                else
                        c = asprintf(&req,
                            "GET %s HTTP/1.0\r\n"
                            "Host: %s\r\n"
+                           "User-Agent: openbsd-acme-client\r\n"
                            "\r\n",
                            http->path, http->host);
        } else {
                c = asprintf(&req,
                    "POST %s HTTP/1.0\r\n"
                    "Host: %s\r\n"
+                   "User-Agent: openbsd-acme-client\r\n"
                    "Content-Length: %zu\r\n"
                    "Content-Type: application/jose+json\r\n"
                    "\r\n",


Have a nice day,
W.

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: acme-client not complient with RFC 8555

Florian Obser-2
Committed with a small tweak, thanks!

On July 11, 2019 11:54:33 PM GMT+02:00, Wolf <[hidden email]> wrote:

>Hello,
>currently openbsd's acme-client breaks RFC 8555 section 6.1, in
>particular sentence
>
>> ACME clients MUST send a User-Agent header field, in accordance with
>> [RFC7231].
>
>Following patch corrects that:
>
>--- a/http.c
>+++ b/http.c
>@@ -344,18 +344,21 @@ http_open(const struct http *http, int h
>                        c = asprintf(&req,
>                            "HEAD %s HTTP/1.0\r\n"
>                            "Host: %s\r\n"
>+                           "User-Agent: openbsd-acme-client\r\n"
>                            "\r\n",
>                            http->path, http->host);
>                else
>                        c = asprintf(&req,
>                            "GET %s HTTP/1.0\r\n"
>                            "Host: %s\r\n"
>+                           "User-Agent: openbsd-acme-client\r\n"
>                            "\r\n",
>                            http->path, http->host);
>        } else {
>                c = asprintf(&req,
>                    "POST %s HTTP/1.0\r\n"
>                    "Host: %s\r\n"
>+                   "User-Agent: openbsd-acme-client\r\n"
>                    "Content-Length: %zu\r\n"
>                    "Content-Type: application/jose+json\r\n"
>                    "\r\n",
>
>
>Have a nice day,
>W.

--
Sent from a mobile device. Please excuse poor formating.