aloopkin / WinCertes

An ACMEv2 client for Windows
GNU General Public License v3.0
118 stars 28 forks source link

Please add User-Agent header #19

Closed jsha closed 4 years ago

jsha commented 4 years ago

Hi,

I'm an engineer at Let's Encrypt. We rely on User-Agent headers from ACME clients to figure out unusual access patterns. Lately I've seen a number of clients in our logs with no User-Agent header. Could you please add a User-Agent header identifying Certes? Here's what RFC 8555 has to say on the topic:

ACME clients MUST send a User-Agent header field, in accordance with
[RFC7231]. This header field SHOULD include the name and version of
the ACME software in addition to the name and version of the
underlying HTTP client software.
aloopkin commented 4 years ago

To be added once done on Certes side as per https://github.com/fszlin/certes/issues/203

jsha commented 4 years ago

Great, thanks! It looks like Certes development has been very quiet recently and I haven't yet seen a reply from the author. Is there any chance you'd be interested in writing a pull request against Certes? That might be easier for the maintainer to approve than having to a write one from scratch.

webprofusion-chrisc commented 4 years ago

One other approach is to use a custom http client and set the user agent for that yourself: https://github.com/webprofusion/certify/blob/60688d3c73853800d95d9e854f404ec22ac008aa/src/Certify.Providers/ACME/Certes/CertesACMEProvider.cs#L140

For what it's worth I do appear to have the ability to merge PRs for Certes but not to make releases etc, really though I don't want to own the library as the author was doing a fantastic job. There was an existing PR for the user agent issue but it didn't appear to allow direct customisation and instead had an opinionated approach which inferred stuff from the calling assemblies.

aloopkin commented 4 years ago

I opted to work-around it as suggested by @webprofusion-chrisc : though i think it's not so great (i would have preferred to leave the HttpClient to Certes lib), it has the big advantage to avoid to fork Certes as i absolutely agree that the author was doing a fantastic job.

Committed as cd2c92a2d5ad5f3479eed6eaf7f640bc6b17830d