9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] aclient: a draft.
@ 2021-07-04  0:52 ori
  2021-07-04 15:30 ` Stanley Lieber
  0 siblings, 1 reply; 6+ messages in thread
From: ori @ 2021-07-04  0:52 UTC (permalink / raw)
  To: 9front

I've been working on a client for ACME cert managemnet
protocol, RFC8555. It's what letsencrypt uses, as well
as several other providers.

It works, though there are probably a few tweaks to be
done before it gets committed, and we should figure out
how to get DNS challenges working.

The code is here until I commit it to 9front:

	http://shithub.us/ori/aclient/HEAD/info.html

Before committing:

- I'd like to figure out a way to add a way to
  add a script to handle the challenge, without
  making the program clunky.
- I'd like add support for DNS challenges.
- I think the default locations may not be
  ideal, and I'd like to see if there are
  better options.
- Get a round of review and thoughts on what
  it should do differently.
- Maybe rename it to honest/acmed -- Honest
  Acmed's guaranteed-unsketchy used cert
  emporium and underwear store.

But it's there, and it works.

Manpage below:

     ACLIENT(8)                                             ACLIENT(8)

     NAME
          aclient - acme certificate client

     SYNOPSIS
          aclient [ -o outdir ] [ -p provider ] [ -a acctkey ] [ c
          csrkey ] [ w chaldir ] acctname domain

     DESCRIPTION
          Aclient fetches and renews TLS certificates using the acme
          protocol.  It requires a pregenerated account key and cer-
          tificate signing key.

          There are a number of options.

          -o   outdir Specifies that the signed certificate is placed
               in outdir in place of the default /sys/lib/tls/acme/.

          -p   provider Specifies that provider is used as the pro-
               vider URL, in place of the default https://acme-
               v02.api.letsencrypt.org/directory. This must be the
               directory URL for the desired RFC8555 compliant pro-
               vider

          -a   acctkey Specifies that acctkey is used to sign requests
               to the provider in place of the default
               /sys/lib/tls/acme/$acctname.pub. The key must be a jwk
               formatted RSA key.

          c    csrkey Specifies that csrkey is used to produce the CSR
               sent to provider in place of the default
               /sys/lib/tls/acme/$domain.key. The key must be a plan 9
               formatted RSA key suitable for aux/rsa2csr.

          w    chaldir Specifies that the challenge is written out to
               chaldir. For HTTP challenges, this defaults to
               /usr/web/.well-known/acme-challenge/.

     EXAMPLES
          Before aclient is run, the keys must be generated.

               auth/rsagen -t 'service=acme role=sign hash=sha256 acct=me@example.org' |
                    tee /sys/lib/acme/me@example.org.priv |
                    auth/rsa2jwk > /sys/lib/acme/me@example.org.pub
               auth/rsagen -t 'service=tls owner=*'
                    >/sys/lib/acme/mydomain.com.key

          This need only be run once.  Once the keys are generated,
          they should be loaded into factotum:

               cat /sys/lib/acme/mydomain.com.key >/mnt/factotum/ctl
               cat /sys/lib/acme/me@example.org.priv >/mnt/factotum/ctl

          The certificate for the domain can now be fetched:

               aclient me@example.org mydomain.com

     SOURCE
          /sys/src/cmd/$somewhere/aclient.c

     BUGS
          Aclient only supports HTTP challenges that placed in static
          directories.  It should add support for DNS challenges, and
          provide a way for a script to be invoked while handling
          them.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-07-07 10:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-04  0:52 [9front] aclient: a draft ori
2021-07-04 15:30 ` Stanley Lieber
2021-07-05  3:37   ` unobe
2021-07-05  9:01     ` hiro
2021-07-05 23:33       ` ori
2021-07-05 23:34   ` ori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).