Uacme: ACMEv2 client written in plain C with minimal dependencies
github.com
github.com
[1] https://github.com/acmesh-official/acme.sh
[2] https://github.com/acmesh-official/acme.sh/wiki/dnsapi
[3] https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Dev-...
Sometimes you write in shell because it's the lowest common denominator.
I get your point, and was pretty shocked to find acme.sh, but after the certbot PPA made a giant mess of my system I gave it a try. On the other hand, why should I balk at running thousands of lines of bash, but be fine with thousands (or many more) lines of C, Python, PERL...? You can write crappy or beautiful code in any language...
If they’re not doing this then I believe they won’t work on older systems even if compiled with old compiler versions.
It has limitations, and quoting takes a hot minute to grok, but those don't come into play for a surprising amount of medium-large projects when used properly.
I use POSIX sh only and get by with maintainability and handling failure modes just fine.
As a specific example, the ACME protocol requires working with json. Doing this in bash is very difficult and error prone, especially if you want to avoid a dependency on something like jq, as this does.
Also it can be highly locked down - run as it's own unprivileged user, with access only to directories served by another webserver for the ACME handshake, storing certs, and a tightly restricted sudoer to restart the webserver on cert cycle.
Also, CLI utility that supports a bunch of APIs:
In the same spirit of minimal and light weight there is also testssh.sh [2] for testing TLS on HTTPS/SMTPS servers that also depends on bash and openssl.
They also provide a CA to go with it, if you need internal certs.
http://git.9front.org/plan9front/plan9front/HEAD/sys/src/cmd...
It works quite well, and if you mount your unix machines via sshfs, it's pretty easy to dump the certs into the right place with them.
And unlike most ACME clients, it works seamlessly with DNS authentication, which allows you to easily grab wildcard certs.
I maintain my own patch, so tiny-acme supports an '--outfile' option (it originally only writes to stdout). This comes in handy when it is run by systemd service/timer.
The pull request is on hold, because the code then exceeds then 200 lines threshold :shrug:
In the end does anyone really care if it’s a 10MB tarball versus a 330kb tarball?
I never had a problem with how long it took to install dependencies until I had to do it multiple times over in quick succession.
Disclaimer: I'm affiliated with Caddy
[0]: https://caddy.community/t/using-caddy-to-keep-certificates-r...
So I'm considering moving to OpenBSD for my web server. The only thing giving me pause currently is that I saw no mention of HTTP/2 support, so I suspect there is none. Although maybe I don't need it. We'll see.
[1]: That last apart I actually already had, but it needed some tweaking this time, because I moved nginx's PID file to its own runtime directory created by systemd, instead of allowing it to write to /run as root.
[2]: Of course only for testing. I revoked them after verifying that everything works. And now they're only assigned dynamically by systemd when the service is run.
0: https://git.sr.ht/~graywolf/acme-client-portable
1: https://data.wolfsden.cz/sources/
2: https://pkgs.alpinelinux.org/packages?name=acme-client&branc...
Admittedly, I haven't updated my blog since then, but goddammit, my SSL certs are still valid! Cough Manjaro Cough
We need more projects like this, because many of us would like clean, reproducible environments that won't be in dependency hell every few years when an update to one dependency isn't compatible with updates to others.
It is fundamental that computers should be able to know whom to trust and whom not.
PKI is the way windows and the corporate world went. On nix you have PGP, with GPG it is sort of baked in I guess but it is used only in package signing and signing of text content in various contexts.
I believe the "web of trust" is preferred over PKI but nix folks because they don't want to depend on certificate authorities mediating trust, instead you have key servers that only help in distributing keys. For *nix, the burden of forming trust is on the user. You have to either go to key signing parties (very scalable lol) or I guess google around and ask in chatrooms and look up trustworthy sites until you are confident a key us trustworthy? I mean you can cross-sign and all that but in reality, you have to investigate each key one by one and hope you don't screw up. Or what happens in most cases is people trusr https/PKI so key IDs on people's websites or a command asking you to import a key from their site over https is trusted... because PKI/TLS is much more practical. Get the GPG fans to like PKI and maybe Linux will have PKI cert management out of the box. The Linux kernel does support X509 and pki certs afaik, I don't know if you can make it store root certs and have it verify cert chains for you from userspace. Very possible but only applications using kTLS might want that. Perhaps a feature request with your favorite browsers and package managers to use kTLS instead of openssl/gnutls is a start?
There is no ACME support built-in either as a client or server, which is sad considering Windows already has dynamic DNS capabilities.
Even Azure Key Vault won't integrate with Microsoft Enterprise PKI, which should tell you everything you need to know...
Instead of using the ualpn daemon to respond to the challenges and proxying all other connections through to nginx, would it be possible to do it solely in nginx?
https://github.com/certbot/certbot/issues/8345#issuecomment-...
Like, squashfs is great and all and packaged app images are an acceptable way of delivering desktop apps... but there's so much lossage here when certbot indirectly requires both just for an install.
(I ended up going with acme.sh instead.)
At least then I know I'll have to run it in a container (and give up then) instead of waste hours figuring out why I get a snap error message when I try to run/install certbot before finally coming to the conclusion it is impossible.
The solution is frequently less software, not more.
(I agree, while certbot works, it's a bit of a usability nightmare.)
(Yeah I currently do this with a cron job so it's not _so_ bad)...
(We get around this, normally, by having regular reboots of the nodes for system updates. So no pod lives long enough for a replacement cert to not get picked up in time, usually. In the off case reboots don't happen, we have alerting.)