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

* Re: [9front] aclient: a draft.
  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 23:34   ` ori
  0 siblings, 2 replies; 6+ messages in thread
From: Stanley Lieber @ 2021-07-04 15:30 UTC (permalink / raw)
  To: 9front

On July 3, 2021 8:52:08 PM EDT, ori@eigenstate.org wrote:
>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.
>
>

ironically, instead of acme doing everything, we now have everything being called acme.

maybe consider /sys/lib/tls/aclient instead of /sys/lib/tls/acme?*

* I assume the scattered references to /sys/lib/acme were meant to be /sys/lib/tls/acme.

sl

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

* Re: [9front] aclient: a draft.
  2021-07-04 15:30 ` Stanley Lieber
@ 2021-07-05  3:37   ` unobe
  2021-07-05  9:01     ` hiro
  2021-07-05 23:34   ` ori
  1 sibling, 1 reply; 6+ messages in thread
From: unobe @ 2021-07-05  3:37 UTC (permalink / raw)
  To: 9front

Quoth Stanley Lieber <sl@stanleylieber.com>:
> On July 3, 2021 8:52:08 PM EDT, ori@eigenstate.org wrote:
> >I've been working on a client for ACME cert managemnet
> >protocol, RFC8555. It's what letsencrypt uses, as well
> >as several other providers.
> ironically, instead of acme doing everything, we now have everything being called acme.
> 
> maybe consider /sys/lib/tls/aclient instead of /sys/lib/tls/acme?*

That is ironic.

Perhaps a foolish thought, but I'll suggest anyway: what if it were
named after the RFC it implements (e.g., /bin/rfc8555/client )?
Boring, but transparent.


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

* Re: [9front] aclient: a draft.
  2021-07-05  3:37   ` unobe
@ 2021-07-05  9:01     ` hiro
  2021-07-05 23:33       ` ori
  0 siblings, 1 reply; 6+ messages in thread
From: hiro @ 2021-07-05  9:01 UTC (permalink / raw)
  To: 9front

i thought it would be called acmed ?

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

* Re: [9front] aclient: a draft.
  2021-07-05  9:01     ` hiro
@ 2021-07-05 23:33       ` ori
  0 siblings, 0 replies; 6+ messages in thread
From: ori @ 2021-07-05 23:33 UTC (permalink / raw)
  To: 9front

Quoth hiro <23hiro@gmail.com>:
> i thought it would be called acmed ?
> 
I initially implementd it as aclient,
and I didn't change it. This complaint
has been addressed now.


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

* Re: [9front] aclient: a draft.
  2021-07-04 15:30 ` Stanley Lieber
  2021-07-05  3:37   ` unobe
@ 2021-07-05 23:34   ` ori
  1 sibling, 0 replies; 6+ messages in thread
From: ori @ 2021-07-05 23:34 UTC (permalink / raw)
  To: 9front

Quoth Stanley Lieber <sl@stanleylieber.com>:

> 
> ironically, instead of acme doing everything, we now have everything being called acme.
> 
> maybe consider /sys/lib/tls/aclient instead of /sys/lib/tls/acme?*
> 
> * I assume the scattered references to /sys/lib/acme were meant to be /sys/lib/tls/acme.
> 
> sl
> 

Yep. Fixed, and changed to acmed instead of
acme or aclient.


^ 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

9front - general discussion about 9front

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/9front

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 9front 9front/ http://inbox.vuxu.org/9front \
		9front@9front.org
	public-inbox-index 9front

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.9front


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git