generate_tlsa
Generate a DANE TLSA record from a certificate or public key to pin a mail server's certificate, preventing STARTTLS stripping and certificate substitution. Includes the DNS record and hash.
Instructions
Build a DANE TLSA record from a certificate or public key — the DNS record that pins which certificate a mail server may present, so an attacker cannot strip STARTTLS or substitute another CA-issued certificate. Paste the PEM (a CERTIFICATE or PUBLIC KEY block) as pem; the hash is computed here because a language model cannot hash. Never send a private key: none is needed and the request is refused if one is present. The three numbers: usage 3 (DANE-EE) pins the end-entity key and needs no CA, selector 1 hashes the SubjectPublicKeyInfo, matching 1 is SHA-256 — the 3 1 1 profile recommended for SMTP, because it survives certificate renewal as long as the key is reused. host must be the mail server hostname from the MX record, not the domain. Two things break DANE and both are reported: a TLSA record in a zone without DNSSEC proves nothing and is ignored, and DANE fails closed, so installing a new certificate before the matching record has propagated stops mail from every sender that validates. Returns the record, the hash, what each number means, and the DNS entry.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pem | Yes | PEM block: -----BEGIN CERTIFICATE----- or -----BEGIN PUBLIC KEY-----. Never a private key. | |
| host | No | Mail server hostname from the MX record, e.g. mail.example.com — not the domain itself. | |
| port | No | Port the record covers. Defaults to 25 for SMTP. | |
| usage | No | 0 PKIX-TA, 1 PKIX-EE, 2 DANE-TA, 3 DANE-EE. Use 3 for SMTP. Defaults to 3. | |
| matching | No | 0 exact, 1 SHA-256, 2 SHA-512. Use 1. Defaults to 1. | |
| selector | No | 0 full certificate, 1 SubjectPublicKeyInfo. Use 1. Defaults to 1. |