Blame src/cli-args.def

Packit aea12f
AutoGen Definitions options;
Packit aea12f
prog-name     = gnutls-cli;
Packit aea12f
prog-title    = "GnuTLS client";
Packit aea12f
prog-desc     = "Simple client program to set up a TLS connection.";
Packit aea12f
short-usage   = "Usage: gnutls-cli [options] hostname\ngnutls-cli --help for usage instructions.\n";
Packit aea12f
explain       = "";
Packit aea12f
detail        = "Simple client program to set up a TLS connection to some other computer. 
Packit aea12f
It sets up a TLS connection and forwards data from the standard input to the secured socket and vice versa.";
Packit aea12f
reorder-args;
Packit aea12f
argument = "[hostname]";
Packit aea12f
Packit aea12f
#define  VERBOSE_OPT 1
Packit aea12f
#include args-std.def
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = tofu;
Packit aea12f
    descrip   = "Enable trust on first use authentication";
Packit aea12f
    disabled;
Packit aea12f
    disable   = "no";
Packit aea12f
    doc       = "This option will, in addition to certificate authentication, perform authentication
Packit aea12f
based on previously seen public keys, a model similar to SSH authentication. Note that when tofu 
Packit aea12f
is specified (PKI) and DANE authentication will become advisory to assist the public key acceptance
Packit aea12f
process.";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = strict-tofu;
Packit aea12f
    descrip   = "Fail to connect if a certificate is unknown or a known certificate has changed";
Packit aea12f
    disabled;
Packit aea12f
    disable   = "no";
Packit aea12f
    doc       = "This option will perform authentication as with option --tofu; however, no questions shall be asked whatsoever, neither to accept an unknown certificate nor a changed one.";
Packit aea12f
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = dane;
Packit aea12f
    descrip   = "Enable DANE certificate verification (DNSSEC)";
Packit aea12f
    disabled;
Packit aea12f
    disable   = "no";
Packit aea12f
    doc       = "This option will, in addition to certificate authentication using 
Packit aea12f
the trusted CAs, verify the server certificates using on the DANE information
Packit aea12f
available via DNSSEC.";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = local-dns;
Packit aea12f
    descrip   = "Use the local DNS server for DNSSEC resolving";
Packit aea12f
    disabled;
Packit aea12f
    disable   = "no";
Packit aea12f
    doc       = "This option will use the local DNS server for DNSSEC.
Packit aea12f
This is disabled by default due to many servers not allowing DNSSEC.";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = ca-verification;
Packit aea12f
    descrip   = "Enable CA certificate verification";
Packit aea12f
    enabled;
Packit aea12f
    disable   = "no";
Packit aea12f
    doc       = "This option can be used to enable or disable CA certificate verification. It is to be used with the --dane or --tofu options.";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = ocsp;
Packit aea12f
    descrip   = "Enable OCSP certificate verification";
Packit aea12f
    disabled;
Packit aea12f
    disable   = "no";
Packit aea12f
    doc       = "This option will enable verification of the peer's certificate using ocsp";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = resume;
Packit aea12f
    value     = r;
Packit aea12f
    descrip   = "Establish a session and resume";
Packit aea12f
    doc       = "Connect, establish a session, reconnect and resume.";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = earlydata;
Packit aea12f
    arg-type  = string;
Packit aea12f
    descrip   = "Send early data on resumption from the specified file";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = rehandshake;
Packit aea12f
    value     = e;
Packit aea12f
    descrip   = "Establish a session and rehandshake";
Packit aea12f
    doc       = "Connect, establish a session and rehandshake immediately.";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = sni-hostname;
Packit aea12f
    descrip   = "Server's hostname for server name indication extension";
Packit aea12f
    arg-type  = string;
Packit aea12f
    doc      = "Set explicitly the server name used in the TLS server name indication extension. That is useful when testing with servers setup on different DNS name than the intended. If not specified, the provided hostname is used. Even with this option server certificate verification still uses the hostname passed on the main commandline. Use --verify-hostname to change this.";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = verify-hostname;
Packit aea12f
    descrip   = "Server's hostname to use for validation";
Packit aea12f
    arg-type  = string;
Packit aea12f
    doc      = "Set explicitly the server name to be used when validating the server's certificate.";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = starttls;
Packit aea12f
    value     = s;
Packit aea12f
    descrip   = "Connect, establish a plain session and start TLS";
Packit aea12f
    doc       = "The TLS session will be initiated when EOF or a SIGALRM is received.";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = app-proto;
Packit aea12f
    aliases   = starttls-proto;
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = starttls-proto;
Packit aea12f
    descrip   = "The application protocol to be used to obtain the server's certificate (https, ftp, smtp, imap, ldap, xmpp, lmtp, pop3, nntp, sieve, postgres)";
Packit aea12f
    arg-type  = string;
Packit aea12f
    doc       = "Specify the application layer protocol for STARTTLS. If the protocol is supported, gnutls-cli will proceed to the TLS negotiation.";
Packit aea12f
    flags-cant = starttls;
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = udp;
Packit aea12f
    value     = u;
Packit aea12f
    descrip   = "Use DTLS (datagram TLS) over UDP";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = mtu;
Packit aea12f
    arg-type  = number;
Packit aea12f
    arg-range = "0->17000";
Packit aea12f
    descrip   = "Set MTU for datagram TLS";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = crlf;
Packit aea12f
    descrip   = "Send CR LF instead of LF";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = fastopen;
Packit aea12f
    descrip   = "Enable TCP Fast Open";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = x509fmtder;
Packit aea12f
    descrip   = "Use DER format for certificates to read from";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = print-cert;
Packit aea12f
    descrip   = "Print peer's certificate in PEM format";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = save-cert;
Packit aea12f
    arg-type  = string;
Packit aea12f
    descrip   = "Save the peer's certificate chain in the specified file in PEM format";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = save-ocsp;
Packit aea12f
    arg-type  = string;
Packit aea12f
    descrip   = "Save the peer's OCSP status response in the provided file";
Packit Service 991b93
    doc       = "";
Packit Service 991b93
    flags-cant = save-ocsp-multi;
Packit Service 991b93
};
Packit Service 991b93
Packit Service 991b93
flag = {
Packit Service 991b93
    name      = save-ocsp-multi;
Packit Service 991b93
    arg-type  = string;
Packit Service 991b93
    descrip   = "Save all OCSP responses provided by the peer in this file";
Packit Service 991b93
    doc       = "The file will contain a list of PEM encoded OCSP status responses if any were provided by the peer, starting with the one for the peer's server certificate.";
Packit Service 991b93
    flags-cant = save-ocsp;
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = save-server-trace;
Packit aea12f
    arg-type  = string;
Packit aea12f
    descrip   = "Save the server-side TLS message trace in the provided file";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = save-client-trace;
Packit aea12f
    arg-type  = string;
Packit aea12f
    descrip   = "Save the client-side TLS message trace in the provided file";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = dh-bits;
Packit aea12f
    arg-type  = number;
Packit aea12f
    descrip   = "The minimum number of bits allowed for DH";
Packit aea12f
    doc      = "This option sets the minimum number of bits allowed for a Diffie-Hellman key exchange. You may want to lower the default value if the peer sends a weak prime and you get an connection error with unacceptable prime.";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = priority;
Packit aea12f
    arg-type  = string;
Packit aea12f
    descrip   = "Priorities string";
Packit aea12f
    doc      = "TLS algorithms and protocols to enable. You can
Packit aea12f
use predefined sets of ciphersuites such as PERFORMANCE,
Packit aea12f
NORMAL, PFS, SECURE128, SECURE256. The default is NORMAL.
Packit aea12f
Packit aea12f
Check  the  GnuTLS  manual  on  section  ``Priority strings'' for more
Packit aea12f
information on the allowed keywords";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = x509cafile;
Packit aea12f
    arg-type  = string;
Packit aea12f
    descrip   = "Certificate file or PKCS #11 URL to use";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = x509crlfile;
Packit aea12f
    arg-type  = file;
Packit aea12f
    file-exists = yes;
Packit aea12f
    descrip   = "CRL file to use";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = x509keyfile;
Packit aea12f
    arg-type  = string;
Packit aea12f
    descrip   = "X.509 key file or PKCS #11 URL to use";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = x509certfile;
Packit aea12f
    arg-type  = string;
Packit aea12f
    descrip   = "X.509 Certificate file or PKCS #11 URL to use";
Packit aea12f
    doc      = "";
Packit aea12f
    flags-must = x509keyfile;
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit Service 991b93
    name      = rawpkkeyfile;
Packit Service 991b93
    arg-type  = string;
Packit Service 991b93
    descrip   = "Private key file (PKCS #8 or PKCS #12) or PKCS #11 URL to use";
Packit Service 991b93
    doc       = "In order to instruct the application to negotiate raw public keys one
Packit Service 991b93
must enable the respective certificate types via the priority strings (i.e. CTYPE-CLI-*
Packit Service 991b93
and CTYPE-SRV-* flags).
Packit Service 991b93
Packit Service 991b93
Check  the  GnuTLS  manual  on  section  ``Priority strings'' for more
Packit Service 991b93
information on how to set certificate types.";
Packit Service 991b93
};
Packit Service 991b93
Packit Service 991b93
flag = {
Packit Service 991b93
    name      = rawpkfile;
Packit Service 991b93
    arg-type  = string;
Packit Service 991b93
    descrip   = "Raw public-key file to use";
Packit Service 991b93
    doc       = "In order to instruct the application to negotiate raw public keys one
Packit Service 991b93
must enable the respective certificate types via the priority strings (i.e. CTYPE-CLI-*
Packit Service 991b93
and CTYPE-SRV-* flags).
Packit Service 991b93
Packit Service 991b93
Check  the  GnuTLS  manual  on  section  ``Priority strings'' for more
Packit Service 991b93
information on how to set certificate types.";
Packit Service 991b93
    flags-must = rawpkkeyfile;
Packit Service 991b93
};
Packit Service 991b93
Packit Service 991b93
flag = {
Packit aea12f
    name      = srpusername;
Packit aea12f
    arg-type  = string;
Packit aea12f
    descrip   = "SRP username to use";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = srppasswd;
Packit aea12f
    arg-type  = string;
Packit aea12f
    descrip   = "SRP password to use";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = pskusername;
Packit aea12f
    arg-type  = string;
Packit aea12f
    descrip   = "PSK username to use";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = pskkey;
Packit aea12f
    arg-type  = string;
Packit aea12f
    descrip   = "PSK key (in hex) to use";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = port;
Packit aea12f
    value     = p;
Packit aea12f
    arg-type  = string;
Packit aea12f
    descrip   = "The port or service to connect to";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = insecure;
Packit aea12f
    descrip   = "Don't abort program if server certificate can't be validated";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = verify-allow-broken;
Packit aea12f
    descrip   = "Allow broken algorithms, such as MD5 for certificate verification";
Packit aea12f
    doc = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = ranges;
Packit aea12f
    descrip   = "Use length-hiding padding to prevent traffic analysis";
Packit aea12f
    doc      = "When possible (e.g., when using CBC ciphersuites), use length-hiding padding to prevent traffic analysis.";
Packit aea12f
    deprecated;
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = benchmark-ciphers;
Packit aea12f
    descrip   = "Benchmark individual ciphers";
Packit aea12f
    doc      = "By default the benchmarked ciphers will utilize any capabilities of the local CPU to improve performance. To test against the raw software implementation set the environment variable GNUTLS_CPUID_OVERRIDE to 0x1.";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = benchmark-tls-kx;
Packit aea12f
    descrip   = "Benchmark TLS key exchange methods";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = benchmark-tls-ciphers;
Packit aea12f
    descrip   = "Benchmark TLS ciphers";
Packit aea12f
    doc      = "By default the benchmarked ciphers will utilize any capabilities of the local CPU to improve performance. To test against the raw software implementation set the environment variable GNUTLS_CPUID_OVERRIDE to 0x1.";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = list;
Packit aea12f
    value     = l;
Packit aea12f
    descrip   = "Print a list of the supported algorithms and modes";
Packit aea12f
    doc      = "Print a list of the supported algorithms and modes. If a priority string is given then only the enabled ciphersuites are shown.";
Packit aea12f
    flags-cant = port;
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = priority-list;
Packit aea12f
    descrip   = "Print a list of the supported priority strings";
Packit aea12f
    doc      = "Print a list of the supported priority strings. The ciphersuites corresponding to each priority string can be examined using -l -p.";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = noticket;
Packit aea12f
    descrip   = "Don't allow session tickets";
Packit aea12f
    doc      = "Disable the request of receiving of session tickets under TLS1.2 or earlier";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = srtp_profiles;
Packit aea12f
    arg-type  = string;
Packit aea12f
    descrip   = "Offer SRTP profiles";
Packit aea12f
    doc       = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = alpn;
Packit aea12f
    arg-type  = string;
Packit aea12f
    descrip   = "Application layer protocol";
Packit aea12f
    max       = NOLIMIT;  /* occurrence limit (none)     */
Packit aea12f
    stack-arg;            /* save opt args in a stack    */
Packit aea12f
    doc      = "This option will set and enable the Application Layer Protocol Negotiation  (ALPN) in the TLS protocol.";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = heartbeat;
Packit aea12f
    value     = b;
Packit aea12f
    descrip   = "Activate heartbeat support";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = recordsize;
Packit aea12f
    arg-type  = number;
Packit aea12f
    arg-range = "0->4096";
Packit aea12f
    descrip   = "The maximum record size to advertize";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = disable-sni;
Packit aea12f
    descrip   = "Do not send a Server Name Indication (SNI)";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = disable-extensions;
Packit aea12f
    descrip   = "Disable all the TLS extensions";
Packit aea12f
    doc      = "This option disables all TLS extensions. Deprecated option. Use the priority string.";
Packit aea12f
    deprecated;
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = single-key-share;
Packit aea12f
    descrip   = "Send a single key share under TLS1.3";
Packit aea12f
    doc      = "This option switches the default mode of sending multiple
Packit aea12f
key shares, to send a single one (the top one).";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = post-handshake-auth;
Packit aea12f
    descrip   = "Enable post-handshake authentication under TLS1.3";
Packit aea12f
    doc      = "This option enables post-handshake authentication when under TLS1.3.";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = inline-commands;
Packit aea12f
    descrip   = "Inline commands of the form ^<cmd>^";
Packit aea12f
    doc       = "Enable inline commands of the form ^<cmd>^. The inline commands are expected to be in a line by themselves. The available commands are: resume, rekey1 (local rekey), rekey (rekey on both peers) and renegotiate.";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = inline-commands-prefix;
Packit aea12f
    arg-type  = string;
Packit aea12f
    descrip   = "Change the default delimiter for inline commands.";
Packit aea12f
    doc       = "Change the default delimiter (^) used for inline commands. The delimiter is expected to be a single US-ASCII character (octets 0 - 127). This option is only relevant if inline commands are enabled via the inline-commands option";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = provider;
Packit aea12f
    arg-type  = file;
Packit aea12f
    file-exists = yes;
Packit aea12f
    descrip   = "Specify the PKCS #11 provider library";
Packit aea12f
    doc      = "This will override the default options in /etc/gnutls/pkcs11.conf";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = fips140-mode;
Packit aea12f
    descrip   = "Reports the status of the FIPS140-2 mode in gnutls library";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = logfile;
Packit aea12f
    arg-type  = string;
Packit aea12f
    descrip   = "Redirect informational messages to a specific file.";
Packit Service 991b93
    doc       = "Redirect informational messages to a specific file. The file may be /dev/null also to make the gnutls client quiet to use it in piped server connections where only the server communication may appear on stdout.";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = keymatexport;
Packit aea12f
    arg-type  = string;
Packit aea12f
    descrip   = "Label used for exporting keying material";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit aea12f
flag = {
Packit aea12f
    name      = keymatexportsize;
Packit aea12f
    arg-type  = number;
Packit aea12f
    descrip   = "Size of the exported keying material";
Packit aea12f
    doc      = "";
Packit aea12f
};
Packit aea12f
Packit Service 991b93
flag = {
Packit Service 991b93
    name     = waitresumption;
Packit Service 991b93
    descrip  = "Block waiting for the resumption data under TLS1.3";
Packit Service 991b93
    doc      = "This option makes the client to block waiting for the resumption data under TLS1.3. The option has effect only when --resume is provided.";
Packit Service 991b93
};
Packit Service 991b93
Packit aea12f
doc-section = {
Packit aea12f
  ds-type   = 'SEE ALSO'; // or anything else
Packit aea12f
  ds-format = 'texi';      // or texi or mdoc format
Packit aea12f
  ds-text   = <<-_EOF_
Packit aea12f
gnutls-cli-debug(1), gnutls-serv(1)
Packit aea12f
_EOF_;
Packit aea12f
};
Packit aea12f
Packit aea12f
doc-section = {
Packit aea12f
  ds-type = 'EXAMPLES';
Packit aea12f
  ds-format = 'texi';
Packit aea12f
  ds-text   = <<-_EOF_
Packit aea12f
@subheading Connecting using PSK authentication
Packit aea12f
To connect to a server using PSK authentication, you need to enable the choice of PSK by using a cipher priority parameter such as in the example below. 
Packit aea12f
@example
Packit aea12f
$ ./gnutls-cli -p 5556 localhost --pskusername psk_identity \
Packit aea12f
    --pskkey 88f3824b3e5659f52d00e959bacab954b6540344 \
Packit aea12f
    --priority NORMAL:-KX-ALL:+ECDHE-PSK:+DHE-PSK:+PSK
Packit aea12f
Resolving 'localhost'...
Packit aea12f
Connecting to '127.0.0.1:5556'...
Packit aea12f
- PSK authentication.
Packit aea12f
- Version: TLS1.1
Packit aea12f
- Key Exchange: PSK
Packit aea12f
- Cipher: AES-128-CBC
Packit aea12f
- MAC: SHA1
Packit aea12f
- Compression: NULL
Packit aea12f
- Handshake was completed
Packit aea12f
    
Packit aea12f
- Simple Client Mode:
Packit aea12f
@end example
Packit Service 991b93
By keeping the --pskusername parameter and removing the --pskkey parameter, it will query only for the password during the handshake.
Packit Service 991b93
Packit Service 991b93
@subheading Connecting using raw public-key authentication
Packit Service 991b93
To connect to a server using raw public-key authentication, you need to enable the option to negotiate raw public-keys via the priority strings such as in the example below. 
Packit Service 991b93
@example
Packit Service 991b93
$ ./gnutls-cli -p 5556 localhost --priority NORMAL:-CTYPE-CLI-ALL:+CTYPE-CLI-RAWPK \
Packit Service 991b93
    --rawpkkeyfile cli.key.pem \
Packit Service 991b93
    --rawpkfile cli.rawpk.pem
Packit Service 991b93
Processed 1 client raw public key pair...
Packit Service 991b93
Resolving 'localhost'...
Packit Service 991b93
Connecting to '127.0.0.1:5556'...
Packit Service 991b93
- Successfully sent 1 certificate(s) to server.
Packit Service 991b93
- Server has requested a certificate.
Packit Service 991b93
- Certificate type: X.509
Packit Service 991b93
- Got a certificate list of 1 certificates.
Packit Service 991b93
- Certificate[0] info:
Packit Service 991b93
 - skipped
Packit Service 991b93
- Description: (TLS1.3-Raw Public Key-X.509)-(ECDHE-SECP256R1)-(RSA-PSS-RSAE-SHA256)-(AES-256-GCM)
Packit Service 991b93
- Options:
Packit Service 991b93
- Handshake was completed
Packit Service 991b93
    
Packit Service 991b93
- Simple Client Mode:
Packit Service 991b93
@end example
Packit aea12f
Packit aea12f
@subheading Connecting to STARTTLS services
Packit aea12f
Packit aea12f
You could also use the client to connect to services with starttls capability.
Packit aea12f
@example
Packit aea12f
$ gnutls-cli --starttls-proto smtp --port 25 localhost
Packit aea12f
@end example
Packit aea12f
Packit aea12f
@subheading Listing ciphersuites in a priority string
Packit aea12f
To list the ciphersuites in a priority string:
Packit aea12f
@example
Packit aea12f
$ ./gnutls-cli --priority SECURE192 -l
Packit aea12f
Cipher suites for SECURE192
Packit aea12f
TLS_ECDHE_ECDSA_AES_256_CBC_SHA384         0xc0, 0x24	TLS1.2
Packit aea12f
TLS_ECDHE_ECDSA_AES_256_GCM_SHA384         0xc0, 0x2e	TLS1.2
Packit aea12f
TLS_ECDHE_RSA_AES_256_GCM_SHA384           0xc0, 0x30	TLS1.2
Packit aea12f
TLS_DHE_RSA_AES_256_CBC_SHA256             0x00, 0x6b	TLS1.2
Packit aea12f
TLS_DHE_DSS_AES_256_CBC_SHA256             0x00, 0x6a	TLS1.2
Packit aea12f
TLS_RSA_AES_256_CBC_SHA256                 0x00, 0x3d	TLS1.2
Packit aea12f
Packit aea12f
Certificate types: CTYPE-X.509
Packit aea12f
Protocols: VERS-TLS1.2, VERS-TLS1.1, VERS-TLS1.0, VERS-SSL3.0, VERS-DTLS1.0
Packit aea12f
Compression: COMP-NULL
Packit aea12f
Elliptic curves: CURVE-SECP384R1, CURVE-SECP521R1
Packit aea12f
PK-signatures: SIGN-RSA-SHA384, SIGN-ECDSA-SHA384, SIGN-RSA-SHA512, SIGN-ECDSA-SHA512
Packit aea12f
@end example
Packit aea12f
Packit aea12f
@subheading Connecting using a PKCS #11 token
Packit aea12f
To connect to a server using a certificate and a private key present in a PKCS #11 token you 
Packit aea12f
need to substitute the PKCS 11 URLs in the x509certfile and x509keyfile parameters.
Packit aea12f
Packit aea12f
Those can be found using "p11tool --list-tokens" and then listing all the objects in the
Packit aea12f
needed token, and using the appropriate.
Packit aea12f
@example
Packit aea12f
$ p11tool --list-tokens
Packit aea12f
Packit aea12f
Token 0:
Packit aea12f
	URL: pkcs11:model=PKCS15;manufacturer=MyMan;serial=1234;token=Test
Packit aea12f
	Label: Test
Packit aea12f
	Manufacturer: EnterSafe
Packit aea12f
	Model: PKCS15
Packit aea12f
	Serial: 1234
Packit aea12f
Packit aea12f
$ p11tool --login --list-certs "pkcs11:model=PKCS15;manufacturer=MyMan;serial=1234;token=Test"
Packit aea12f
Packit aea12f
Object 0:
Packit aea12f
	URL: pkcs11:model=PKCS15;manufacturer=MyMan;serial=1234;token=Test;object=client;type=cert
Packit aea12f
	Type: X.509 Certificate
Packit aea12f
	Label: client
Packit aea12f
	ID: 2a:97:0d:58:d1:51:3c:23:07:ae:4e:0d:72:26:03:7d:99:06:02:6a
Packit aea12f
Packit aea12f
$ MYCERT="pkcs11:model=PKCS15;manufacturer=MyMan;serial=1234;token=Test;object=client;type=cert"
Packit aea12f
$ MYKEY="pkcs11:model=PKCS15;manufacturer=MyMan;serial=1234;token=Test;object=client;type=private"
Packit aea12f
$ export MYCERT MYKEY
Packit aea12f
Packit aea12f
$ gnutls-cli www.example.com --x509keyfile $MYKEY --x509certfile $MYCERT
Packit aea12f
@end example
Packit aea12f
Notice that the private key only differs from the certificate in the type.
Packit aea12f
_EOF_;
Packit aea12f
};