HTTPS and a reserved name

Two jobs are described together. A reserved name is a name that stays on your disk after the agent exits. HTTPS is which certificate is put on that address.

tunl http 3000 --name demo

--name writes the address to adit-data.json. The same name is still yours after aditd restarts. While the agent is away, a request returns 503. Temporary names do not go into this file.

To release the name while the tunnel is closed:

DELETE /api/reservations/demo

This call is the panel API. If a token is set and the request is not from this machine, the session cookie is required. Panel session

Self-signed certificate

Without --acme-email, the server produces adit-cert.pem. The browser warns. That is enough for a local trial.

For your own files, use --tls-cert and --tls-key. The environment variables are ADIT_TLS_CERT and ADIT_TLS_KEY.

Let's Encrypt

aditd --http :80 --https :443 --domain example.com --acme-email [email protected] --token bir-belirtec

If --acme-email is set, the certificate is obtained from Let's Encrypt and kept in the --acme-cache directory. It is renewed before it expires. The HTTP endpoint must be 80 and the HTTPS endpoint 443. The domain's A record must point at this machine. --acme-staging is there for a trial. That directory does not produce a certificate browsers trust.

A certificate is requested only for the apex and for names that are open or reserved at that moment. If someone outside opens a TLS connection for a random subdomain, no order starts; that keeps Let's Encrypt's weekly limit per domain from being spent for nothing. The first time a new name is used, its certificate is obtained then, and that takes a few seconds.

A wildcard certificate (*.example.com) needs DNS validation at Let's Encrypt; tunl.surf does not do that. If you already have a wildcard, pass it with --tls-cert and --tls-key.

To encrypt the control and panel ports with the same certificate, there are the --control-tls and --ui-tls flags.

To turn HTTPS off: aditd --https off --token bir-belirtec.

If there is no DNS

The default domain 127.0.0.1.sslip.io resolves to this machine. If your own name does not resolve, pass --domain and write the name into the hosts file.