Trust-ACME orders and manages certificates. DNS challenges and DANE are done with Trust-DNS.
User's trust should be founded on strong defaults and only a few chosen dependencies.
Currently it just reads its config file and orders all configured certificates without further logic.
First we set up a Trust-DNS server. Warning: This config is a personal flavor. ```console
```
nano /etc/trust-dns/config.toml ```toml listenaddrsipv4 = ["your public ipv4 address"] listenaddrsipv6 = ["::1", "your public ipv6 address"] listen_port = 53
[[zones]]
zone = "example.com"
zonetype = "Master"
enablednssec = true
stores = { type = "sqlite", zonefilepath = "example.com", journalfilepath = "example.com.jrnl", allowupdate = true }
keys = [{keypath="keys/example.com.pk8", algorithm="ECDSAP384SHA384", iszonesigningkey=true}, {keypath="keys/dnsauth.pk8", algorithm="ED25519", iszoneupdateauth=true}]
``
([Official examples](https://github.com/bluejekyll/trust-dns/blob/master/crates/server/tests/named_test_configs/dnssec_with_update.toml) don't use inline tables for
keys`; I just prefer to have compact zone configs.)
nano /etc/trust-dns/zones/example.com
@ 86400 IN SOA ns1.example.com. hostmaster.example.com. (
201903010 ; Serial
3600 ; Refresh
600 ; Retry
86400 ; Expire
600) ; Negative TTL
@ 86400 IN NS ns1.example.com.
@ 86400 IN NS ns2.example.com.
@ 86400 IN MX 5 mail.example.com.
@ 86400 IN TXT "v=spf1 mx -all"
@ 86400 IN CAA 0 issue "letsencrypt.org; validationmethods=dns-01"
@ 86400 IN CAA 0 iodef "mailto:hostmaster@example.com"
@ 86400 IN AAAA ::1
www 86400 IN AAAA ::1
www 86400 IN MX 0 .
ns1 86400 IN AAAA ::1
ns1 86400 IN A 127.0.0.1
ns1 86400 IN MX 0 .
ns2 86400 IN AAAA ::1
ns2 86400 IN A 127.0.0.1
ns2 86400 IN MX 0 .
mail 86400 IN AAAA ::1
mail 86400 IN A 127.0.0.1
Let's check how it goes: ```console
```
As long we don't have a nice systemd service: ```console
cd /etc/trust-dns; screen -dmS trust-dns named --config /etc/trust-dns/config.toml --zonedir /etc/trust-dns/zones EOF
```
How to get the DNSKEY for your DNS provider to make DNSSEC actually working?
console
$ dig DNSKEY example.com @trust-dns-server-ip +short +nosplit
You just want to try it out with a sub domain as zone and need to generate a DS record?
Use https://filippo.io/dnskey-to-ds/.
Let's proceed and install trust-acme: ```console
nano /etc/trust-acme/config.toml
toml
[ca.letsencrypt]
directory = "https://acme-staging-v02.api.letsencrypt.org/directory"
accountkey = "/etc/trust-acme/letsencryptaccount.pk8"
account_email = "hostmaster@example.com"
[trustdns.default] server = "[::1]:53" authkey = "/etc/trust-dns/keys/dnsauth.pk8"
[[cert]] zone = "example.com"
pem_key = true reload = ["nginx"] san = [ { name = "example.com", tcp = [443] }, { name = "www.example.com", tcp = [443] }, ]
#
``
If you comment out
directory`, the real Let's Encrypt will be used. For simplicity regarding TLSA records it's currently not possible to have SAN entries from different zones. At the moment, only ECDSA P-384 certificates are supported.
To order, just run: ```console
```
A certificate's first SAN entry will be used as its file name:
Certificate path: /etc/trust-acme/certs/example.com.crt
Key path (Rustls): /etc/trust-acme/certs/example.com.pk8
Key path (OpenSSL): /etc/trust-acme/certs/example.com.key