.TH gnutls-cli 1 "23 Nov 2013" "3.2.7" "User Commands" .\" .\" DO NOT EDIT THIS FILE (cli-args.man) .\" .\" It has been AutoGen-ed November 23, 2013 at 03:55:47 PM by AutoGen 5.18.2 .\" From the definitions cli-args.def.tmp .\" and the template file agman-cmd.tpl .\" .SH NAME gnutls-cli \- GnuTLS client .SH SYNOPSIS .B gnutls-cli .\" Mixture of short (flag) options and long options .RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \-\-\fIopt\-name\fP "[[=| ]\fIvalue\fP]]..." " " "[hostname]" .PP Operands and options may be intermixed. They will be reordered. .PP .SH "DESCRIPTION" Simple client program to set up a TLS connection to some other computer. It sets up a TLS connection and forwards data from the standard input to the secured socket and vice versa. .SH "OPTIONS" .TP .BR \-d " \fInumber\fP, " \-\-debug "=" \fInumber\fP Enable debugging. This option takes an integer number as its argument. The value of \fInumber\fP is constrained to being: .in +4 .nf .na in the range 0 through 9999 .fi .in -4 .sp Specifies the debug level. .TP .BR \-V ", " \-\-verbose More verbose output. This option may appear an unlimited number of times. .sp .TP .BR \-\-tofu, " \fB\-\-no\-tofu\fP" Enable trust on first use authentication. The \fIno\-tofu\fP form will disable the option. .sp This option will, in addition to certificate authentication, perform authentication based on previously seen public keys, a model similar to SSH authentication. .TP .BR \-\-dane, " \fB\-\-no\-dane\fP" Enable DANE certificate verification (DNSSEC). The \fIno\-dane\fP form will disable the option. .sp This option will, in addition to certificate authentication using the trusted CAs, verify the server certificates using on the DANE information available via DNSSEC. .TP .BR \-\-local\-dns, " \fB\-\-no\-local\-dns\fP" Use the local DNS server for DNSSEC resolving. The \fIno\-local\-dns\fP form will disable the option. .sp This option will use the local DNS server for DNSSEC. This is disabled by default due to many servers not allowing DNSSEC. .TP .BR \-\-ca\-verification, " \fB\-\-no\-ca\-verification\fP" Disable CA certificate verification. The \fIno\-ca\-verification\fP form will disable the option. This option is enabled by default. .sp This option will disable CA certificate verification. It is to be used with the \--dane or \--tofu options. .TP .BR \-\-ocsp, " \fB\-\-no\-ocsp\fP" Enable OCSP certificate verification. The \fIno\-ocsp\fP form will disable the option. .sp This option will enable verification of the peer's certificate using ocsp .TP .BR \-r ", " \-\-resume Establish a session and resume. .sp Connect, establish a session, reconnect and resume. .TP .BR \-e ", " \-\-rehandshake Establish a session and rehandshake. .sp Connect, establish a session and rehandshake immediately. .TP .BR \-s ", " \-\-starttls Connect, establish a plain session and start TLS. .sp The TLS session will be initiated when EOF or a SIGALRM is received. .TP .BR \-u ", " \-\-udp Use DTLS (datagram TLS) over UDP. .sp .TP .BR \-\-mtu "=\fInumber\fP" Set MTU for datagram TLS. This option takes an integer number as its argument. The value of \fInumber\fP is constrained to being: .in +4 .nf .na in the range 0 through 17000 .fi .in -4 .sp .TP .BR \-\-crlf Send CR LF instead of LF. .sp .TP .BR \-\-x509fmtder Use DER format for certificates to read from. .sp .TP .BR \-f ", " \-\-fingerprint Send the openpgp fingerprint, instead of the key. .sp .TP .BR \-\-print\-cert Print peer's certificate in PEM format. .sp .TP .BR \-\-dh\-bits "=\fInumber\fP" The minimum number of bits allowed for DH. This option takes an integer number as its argument. .sp 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. .TP .BR \-\-priority "=\fIstring\fP" Priorities string. .sp TLS algorithms and protocols to enable. You can use predefined sets of ciphersuites such as PERFORMANCE, NORMAL, SECURE128, SECURE256. .sp Check the GnuTLS manual on section \(lqPriority strings\(rq for more information on allowed keywords .TP .BR \-\-x509cafile "=\fIstring\fP" Certificate file or PKCS #11 URL to use. .sp .TP .BR \-\-x509crlfile "=\fIfile\fP" CRL file to use. .sp .TP .BR \-\-pgpkeyfile "=\fIfile\fP" PGP Key file to use. .sp .TP .BR \-\-pgpkeyring "=\fIfile\fP" PGP Key ring file to use. .sp .TP .BR \-\-pgpcertfile "=\fIfile\fP" PGP Public Key (certificate) file to use. .sp .TP .BR \-\-x509keyfile "=\fIstring\fP" X.509 key file or PKCS #11 URL to use. .sp .TP .BR \-\-x509certfile "=\fIstring\fP" X.509 Certificate file or PKCS #11 URL to use. .sp .TP .BR \-\-pgpsubkey "=\fIstring\fP" PGP subkey to use (hex or auto). .sp .TP .BR \-\-srpusername "=\fIstring\fP" SRP username to use. .sp .TP .BR \-\-srppasswd "=\fIstring\fP" SRP password to use. .sp .TP .BR \-\-pskusername "=\fIstring\fP" PSK username to use. .sp .TP .BR \-\-pskkey "=\fIstring\fP" PSK key (in hex) to use. .sp .TP .BR \-p " \fIstring\fP, " \-\-port "=" \fIstring\fP The port or service to connect to. .sp .TP .BR \-\-insecure Don't abort program if server certificate can't be validated. .sp .TP .BR \-\-ranges Use length-hiding padding to prevent traffic analysis. .sp When possible (e.g., when %NEW_PADDING is specified), use length-hiding padding to prevent traffic analysis. .TP .BR \-\-benchmark\-ciphers Benchmark individual ciphers. .sp .TP .BR \-\-benchmark\-soft\-ciphers Benchmark individual software ciphers (no hw acceleration). .sp .TP .BR \-\-benchmark\-tls\-kx Benchmark TLS key exchange methods. .sp .TP .BR \-\-benchmark\-tls\-ciphers Benchmark TLS ciphers. .sp .TP .BR \-l ", " \-\-list Print a list of the supported algorithms and modes. .sp Print a list of the supported algorithms and modes. If a priority string is given then only the enabled ciphersuites are shown. .TP .BR \-\-noticket Don't allow session tickets. .sp .TP .BR \-\-srtp\-profiles "=\fIstring\fP" Offer SRTP profiles. .sp .TP .BR \-\-alpn "=\fIstring\fP" Application layer protocol. This option may appear an unlimited number of times. .sp This option will set and enable the Application Layer Protocol Negotiation (ALPN) in the TLS protocol. .TP .BR \-b ", " \-\-heartbeat Activate heartbeat support. .sp .TP .BR \-\-recordsize "=\fInumber\fP" The maximum record size to advertize. This option takes an integer number as its argument. The value of \fInumber\fP is constrained to being: .in +4 .nf .na in the range 0 through 4096 .fi .in -4 .sp .TP .BR \-\-disable\-sni Do not send a Server Name Indication (SNI). .sp .TP .BR \-\-disable\-extensions Disable all the TLS extensions. .sp This option disables all TLS extensions. Deprecated option. Use the priority string. .TP .BR \-\-inline\-commands Inline commands of the form ^^. .sp Enable inline commands of the form ^^. The inline commands are expected to be in a line by themselves. The available commands are: resume and renegotiate. .TP .BR \-\-inline\-commands\-prefix "=\fIstring\fP" Change the default (^) used as a delimiter for inline commands. The value is a single US-ASCII character (octets 0 \- 127).. .sp 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 .TP .BR \-h , " \-\-help" Display usage information and exit. .TP .BR \-! , " \-\-more-help" Pass the extended usage information through a pager. .TP .BR \-v " [{\fIv|c|n\fP}]," " \-\-version" "[={\fIv|c|n\fP}]" 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. .SH EXAMPLES .br \fBConnecting using PSK authentication\fP .br 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. .br .in +4 .nf $ ./gnutls\-cli \-p 5556 localhost \-\-pskusername psk_identity \ \-\-pskkey 88f3824b3e5659f52d00e959bacab954b6540344 \ \-\-priority NORMAL:\-KX\-ALL:+ECDHE\-PSK:+DHE\-PSK:+PSK Resolving 'localhost'... Connecting to '127.0.0.1:5556'... - PSK authentication. - Version: TLS1.1 - Key Exchange: PSK - Cipher: AES\-128\-CBC - MAC: SHA1 - Compression: NULL - Handshake was completed - Simple Client Mode: .in -4 .fi By keeping the \-\-pskusername parameter and removing the \-\-pskkey parameter, it will query only for the password during the handshake. .sp .br \fBListing ciphersuites in a priority string\fP .br To list the ciphersuites in a priority string: .br .in +4 .nf $ ./gnutls\-cli \-\-priority SECURE192 \-l Cipher suites for SECURE192 TLS_ECDHE_ECDSA_AES_256_CBC_SHA384 0xc0, 0x24 TLS1.2 TLS_ECDHE_ECDSA_AES_256_GCM_SHA384 0xc0, 0x2e TLS1.2 TLS_ECDHE_RSA_AES_256_GCM_SHA384 0xc0, 0x30 TLS1.2 TLS_DHE_RSA_AES_256_CBC_SHA256 0x00, 0x6b TLS1.2 TLS_DHE_DSS_AES_256_CBC_SHA256 0x00, 0x6a TLS1.2 TLS_RSA_AES_256_CBC_SHA256 0x00, 0x3d TLS1.2 .sp Certificate types: CTYPE\-X.509 Protocols: VERS\-TLS1.2, VERS\-TLS1.1, VERS\-TLS1.0, VERS\-SSL3.0, VERS\-DTLS1.0 Compression: COMP\-NULL Elliptic curves: CURVE\-SECP384R1, CURVE\-SECP521R1 PK\-signatures: SIGN\-RSA\-SHA384, SIGN\-ECDSA\-SHA384, SIGN\-RSA\-SHA512, SIGN\-ECDSA\-SHA512 .in -4 .fi .sp .br \fBConnecting using a PKCS #11 token\fP .br To connect to a server using a certificate and a private key present in a PKCS #11 token you need to substitute the PKCS 11 URLs in the x509certfile and x509keyfile parameters. .sp Those can be found using "p11tool \-\-list\-tokens" and then listing all the objects in the needed token, and using the appropriate. .br .in +4 .nf $ p11tool \-\-list\-tokens .sp Token 0: URL: pkcs11:model=PKCS15;manufacturer=MyMan;serial=1234;token=Test Label: Test Manufacturer: EnterSafe Model: PKCS15 Serial: 1234 .sp $ p11tool \-\-login \-\-list\-certs "pkcs11:model=PKCS15;manufacturer=MyMan;serial=1234;token=Test" .sp Object 0: URL: pkcs11:model=PKCS15;manufacturer=MyMan;serial=1234;token=Test;object=client;object\-type=cert Type: X.509 Certificate Label: client ID: 2a:97:0d:58:d1:51:3c:23:07:ae:4e:0d:72:26:03:7d:99:06:02:6a .sp $ export MYCERT="pkcs11:model=PKCS15;manufacturer=MyMan;serial=1234;token=Test;object=client;object\-type=cert" $ export MYKEY="pkcs11:model=PKCS15;manufacturer=MyMan;serial=1234;token=Test;object=client;object\-type=private" .sp $ gnutls\-cli www.example.com \-\-x509keyfile $MYKEY \-\-x509certfile MYCERT .in -4 .fi Notice that the private key only differs from the certificate in the object\-type. .SH "EXIT STATUS" One of the following exit values will be returned: .TP .BR 0 " (EXIT_SUCCESS)" Successful program execution. .TP .BR 1 " (EXIT_FAILURE)" The operation failed or the command syntax was not valid. .TP .BR 70 " (EX_SOFTWARE)" libopts had an internal operational error. Please report it to autogen-users@lists.sourceforge.net. Thank you. .SH "SEE ALSO" gnutls\-cli\-debug(1), gnutls\-serv(1) .SH "AUTHORS" Nikos Mavrogiannopoulos, Simon Josefsson and others; see /usr/share/doc/gnutls-bin/AUTHORS for a complete list. .SH "COPYRIGHT" Copyright (C) 2000-2012 Free Software Foundation all rights reserved. This program is released under the terms of the GNU General Public License, version 3 or later. .SH "BUGS" Please send bug reports to: bugs@gnutls.org .SH "NOTES" This manual page was \fIAutoGen\fP-erated from the \fBgnutls-cli\fP option definitions.