Previous: , Up: More on certificate authentication   [Contents][Index]


4.2.8 Invoking danetool

Tool to generate and check DNS resource records for the DANE protocol.

danetool help/usage (-?)

The text printed is the same whether selected with the help option (--help) or the more-help option (--more-help). more-help will print the usage text by passing it through a pager program. more-help is disabled on platforms without a working fork(2) function. The PAGER environment variable is used to select the program, defaulting to more. Both will exit with a status code of 0.

danetool - GnuTLS DANE tool
Usage:  danetool [ -<flag> [<val>] | --<name>[{=| }<val>] ]... 

None:

   -d, --debug=num            Enable debugging
				- it must be in the range:
				  0 to 9999
   -V, --verbose              More verbose output
       --outfile=str          Output file
       --load-pubkey=str      Loads a public key file
       --load-certificate=str Loads a certificate file
       --dlv=str              Sets a DLV file
       --hash=str             Hash algorithm to use for signing
       --check=str            Check a host's DANE TLSA entry
       --check-ee             Check only the end-entity's certificate
       --check-ca             Check only the CA's certificate
       --tlsa-rr              Print the DANE RR data on a certificate or public key
				- requires the option 'host'
       --host=str             Specify the hostname to be used in the DANE RR
       --proto=str            The protocol set for DANE data (tcp, udp etc.)
       --port=str             The port or service to connect to, for DANE data
       --app-proto            an alias for the 'starttls-proto' option
       --starttls-proto=str   The application protocol to be used to obtain the server's certificate (https, ftp, smtp, imap, ldap, xmpp, lmtp, pop3, nntp, sieve, postgres)
       --ca                   Whether the provided certificate or public key is a Certificate Authority
       --x509                 Use the hash of the X.509 certificate, rather than the public key
       --local                an alias for the 'domain' option
       --domain               The provided certificate or public key is issued by the local domain
				- enabled by default
				- disabled as '--no-domain'
       --local-dns            Use the local DNS server for DNSSEC resolving
       --insecure             Do not verify any DNSSEC signature
       --inder                Use DER format for input certificates and private keys
       --inraw                an alias for the 'inder' option
       --print-raw            Print the received DANE data in raw format
       --quiet                Suppress several informational messages

Version, usage and configuration options:

   -v, --version[=arg]        output version information and exit
   -h, --help                 display extended usage information and exit
   -!, --more-help            extended usage information passed thru pager

Options are specified by doubled hyphens and their name or by a single
hyphen and the flag character.

Tool to generate and check DNS resource records for the DANE protocol.

Please send bug reports to:  <bugs@gnutls.org>

debug option (-d).

This is the “enable debugging” option. This option takes a ArgumentType.NUMBER argument. Specifies the debug level.

load-pubkey option.

This is the “loads a public key file” option. This option takes a ArgumentType.STRING argument. This can be either a file or a PKCS #11 URL

load-certificate option.

This is the “loads a certificate file” option. This option takes a ArgumentType.STRING argument. This can be either a file or a PKCS #11 URL

dlv option.

This is the “sets a dlv file” option. This option takes a ArgumentType.STRING argument. This sets a DLV file to be used for DNSSEC verification.

hash option.

This is the “hash algorithm to use for signing” option. This option takes a ArgumentType.STRING argument. Available hash functions are SHA1, RMD160, SHA256, SHA384, SHA512.

check option.

This is the “check a host’s dane tlsa entry” option. This option takes a ArgumentType.STRING argument. Obtains the DANE TLSA entry from the given hostname and prints information. Note that the actual certificate of the host can be provided using –load-certificate, otherwise danetool will connect to the server to obtain it. The exit code on verification success will be zero.

check-ee option.

This is the “check only the end-entity’s certificate” option. Checks the end-entity’s certificate only. Trust anchors or CAs are not considered.

check-ca option.

This is the “check only the ca’s certificate” option. Checks the trust anchor’s and CA’s certificate only. End-entities are not considered.

tlsa-rr option.

This is the “print the dane rr data on a certificate or public key” option.

This option has some usage constraints. It:

This command prints the DANE RR data needed to enable DANE on a DNS server.

host option.

This is the “specify the hostname to be used in the dane rr” option. This option takes a ArgumentType.STRING argument Hostname. This command sets the hostname for the DANE RR.

proto option.

This is the “the protocol set for dane data (tcp, udp etc.)” option. This option takes a ArgumentType.STRING argument Protocol. This command specifies the protocol for the service set in the DANE data.

app-proto option.

This is an alias for the starttls-proto option, see the starttls-proto option documentation.

starttls-proto option.

This is the “the application protocol to be used to obtain the server’s certificate (https, ftp, smtp, imap, ldap, xmpp, lmtp, pop3, nntp, sieve, postgres)” option. This option takes a ArgumentType.STRING argument. When the server’s certificate isn’t provided danetool will connect to the server to obtain the certificate. In that case it is required to know the protocol to talk with the server prior to initiating the TLS handshake.

ca option.

This is the “whether the provided certificate or public key is a certificate authority” option. Marks the DANE RR as a CA certificate if specified.

x509 option.

This is the “use the hash of the x.509 certificate, rather than the public key” option. This option forces the generated record to contain the hash of the full X.509 certificate. By default only the hash of the public key is used.

local option.

This is an alias for the domain option, see the domain option documentation.

domain option.

This is the “the provided certificate or public key is issued by the local domain” option.

This option has some usage constraints. It:

DANE distinguishes certificates and public keys offered via the DNSSEC to trusted and local entities. This flag indicates that this is a domain-issued certificate, meaning that there could be no CA involved.

local-dns option.

This is the “use the local dns server for dnssec resolving” option. This option will use the local DNS server for DNSSEC. This is disabled by default due to many servers not allowing DNSSEC.

insecure option.

This is the “do not verify any dnssec signature” option. Ignores any DNSSEC signature verification results.

inder option.

This is the “use der format for input certificates and private keys” option. The input files will be assumed to be in DER or RAW format. Unlike options that in PEM input would allow multiple input data (e.g. multiple certificates), when reading in DER format a single data structure is read.

inraw option.

This is an alias for the inder option, see the inder option documentation.

print-raw option.

This is the “print the received dane data in raw format” option. This option will print the received DANE data.

quiet option.

This is the “suppress several informational messages” option. In that case on the exit code can be used as an indication of verification success

version option (-v).

This is the “output version information and exit” option. This option takes a ArgumentType.KEYWORD argument. Output version of program and exit. The default mode is ‘v’, a simple version. The ‘c’ mode will print copyright information and ‘n’ will print the full copyright notice.

help option (-h).

This is the “display extended usage information and exit” option. Display usage information and exit.

more-help option (-!).

This is the “extended usage information passed thru pager” option. Pass the extended usage information through a pager.

danetool exit status

One of the following exit values will be returned:

0 (EXIT_SUCCESS)

Successful program execution.

1 (EXIT_FAILURE)

The operation failed or the command syntax was not valid.

danetool See Also

certtool (1)

danetool Examples

DANE TLSA RR generation

To create a DANE TLSA resource record for a certificate (or public key) that was issued localy and may or may not be signed by a CA use the following command.

$ danetool --tlsa-rr --host www.example.com --load-certificate cert.pem

To create a DANE TLSA resource record for a CA signed certificate, which will be marked as such use the following command.

$ danetool --tlsa-rr --host www.example.com --load-certificate cert.pem \
  --no-domain

The former is useful to add in your DNS entry even if your certificate is signed by a CA. That way even users who do not trust your CA will be able to verify your certificate using DANE.

In order to create a record for the CA signer of your certificate use the following.

$ danetool --tlsa-rr --host www.example.com --load-certificate cert.pem \
  --ca --no-domain

To read a server’s DANE TLSA entry, use:

$ danetool --check www.example.com --proto tcp --port 443

To verify an HTTPS server’s DANE TLSA entry, use:

$ danetool --check www.example.com --proto tcp --port 443 --load-certificate chain.pem

To verify an SMTP server’s DANE TLSA entry, use:

$ danetool --check www.example.com --proto tcp --starttls-proto=smtp --load-certificate chain.pem

Previous: , Up: More on certificate authentication   [Contents][Index]