documented updates
[gnutls.git] / doc / invoke-gnutls-cli.texi
blobade332a00531a247306a334a449864ad592d9370
1 @node gnutls-cli Invocation
2 @section Invoking gnutls-cli
3 @pindex gnutls-cli
4 @cindex GnuTLS client
5 @ignore
6 #  -*- buffer-read-only: t -*- vi: set ro:
7
8 # DO NOT EDIT THIS FILE   (invoke-gnutls-cli.texi)
9
10 # It has been AutoGen-ed  October  7, 2012 at 10:36:28 AM by AutoGen 5.16
11 # From the definitions    ../src/cli-args.def
12 # and the template file   agtexi-cmd.tpl
13 @end ignore
16 Simple client program to set up a TLS connection to some other computer. 
17 It sets up a TLS connection and forwards data from the standard input to the secured socket and vice versa.
19 This section was generated by @strong{AutoGen},
20 using the @code{agtexi-cmd} template and the option descriptions for the @code{gnutls-cli} program.
21 This software is released under the GNU General Public License, version 3 or later.
24 @anchor{gnutls-cli usage}
25 @subheading gnutls-cli help/usage (-h)
26 @cindex gnutls-cli help
28 This is the automatically generated usage text for gnutls-cli.
29 The text printed is the same whether for the @code{help} option (-h) or the @code{more-help} option (-!).  @code{more-help} will print
30 the usage text by passing it through a pager program.
31 @code{more-help} is disabled on platforms without a working
32 @code{fork(2)} function.  The @code{PAGER} environment variable is
33 used to select the program, defaulting to @file{more}.  Both will exit
34 with a status code of 0.
36 @exampleindent 0
37 @example
38 gnutls-cli - GnuTLS client - Ver. @@VERSION@@
39 USAGE:  gnutls-cli [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [hostname]
41    -d, --debug=num            Enable debugging.
42                                 - It must be in the range:
43                                   0 to 9999
44    -V, --verbose              More verbose output
45                                 - may appear multiple times
46        --tofu                 Enable trust on first use authentication
47                                 - disabled as --no-tofu
48        --dane                 Enable DANE certificate verification (DNSSEC)
49                                 - disabled as --no-dane
50        --ca-verification      Disable CA certificate verification
51                                 - disabled as --no-ca-verification
52                                 - enabled by default
53        --ocsp                 Enable OCSP certificate verification
54                                 - disabled as --no-ocsp
55    -r, --resume               Establish a session and resume
56    -b, --heartbeat            Activate heartbeat support
57    -e, --rehandshake          Establish a session and rehandshake
58        --noticket             Don't accept session tickets
59        --ocsp-status-request  Enable OCSP status request
60                                 - disabled as --no-ocsp-status-request
61                                 - enabled by default
62    -s, --starttls             Connect, establish a plain session and start TLS.
63    -u, --udp                  Use DTLS (datagram TLS) over UDP
64        --mtu=num              Set MTU for datagram TLS
65                                 - It must be in the range:
66                                   0 to 17000
67        --crlf                 Send CR LF instead of LF
68        --x509fmtder           Use DER format for certificates to read from
69    -f, --fingerprint          Send the openpgp fingerprint, instead of the key
70        --disable-extensions   Disable all the TLS extensions
71        --print-cert           Print peer's certificate in PEM format
72        --recordsize=num       The maximum record size to advertize
73                                 - It must be in the range:
74                                   0 to 4096
75        --dh-bits=num          The minimum number of bits allowed for DH
76        --priority=str         Priorities string
77        --x509cafile=str       Certificate file or PKCS #11 URL to use
78        --x509crlfile=file     CRL file to use
79                                 - file must pre-exist
80        --pgpkeyfile=file      PGP Key file to use
81                                 - file must pre-exist
82        --pgpkeyring=file      PGP Key ring file to use
83                                 - file must pre-exist
84        --pgpcertfile=file     PGP Public Key (certificate) file to use
85                                 - file must pre-exist
86        --x509keyfile=str      X.509 key file or PKCS #11 URL to use
87        --x509certfile=str     X.509 Certificate file or PKCS #11 URL to use
88        --pgpsubkey=str        PGP subkey to use (hex or auto)
89        --srpusername=str      SRP username to use
90        --srppasswd=str        SRP password to use
91        --pskusername=str      PSK username to use
92        --pskkey=str           PSK key (in hex) to use
93    -p, --port=str             The port or service to connect to
94        --insecure             Don't abort program if server certificate can't be validated
95        --benchmark-ciphers    Benchmark individual ciphers
96        --benchmark-soft-ciphers  Benchmark individual software ciphers (no hw acceleration)
97        --benchmark-tls-kx     Benchmark TLS key exchange methods
98        --benchmark-tls-ciphers  Benchmark TLS ciphers
99    -l, --list                 Print a list of the supported algorithms and modes
100    -v, --version[=arg]        Output version information and exit
101    -h, --help                 Display extended usage information and exit
102    -!, --more-help            Extended usage information passed thru pager
104 Options are specified by doubled hyphens and their name or by a single
105 hyphen and the flag character.
106 Operands and options may be intermixed.  They will be reordered.
110 Simple client program to set up a TLS connection to some other computer.  It
111 sets up a TLS connection and forwards data from the standard input to the
112 secured socket and vice versa.
114 please send bug reports to:  bug-gnutls@@gnu.org
115 @end example
116 @exampleindent 4
118 @anchor{gnutls-cli debug}
119 @subheading debug option (-d)
120 @cindex gnutls-cli-debug
122 This is the ``enable debugging.'' option.
123 This option takes an argument number.
124 Specifies the debug level.
125 @anchor{gnutls-cli tofu}
126 @subheading tofu option
127 @cindex gnutls-cli-tofu
129 This is the ``enable trust on first use authentication'' option.
130 This option will, in addition to certificate authentication, perform authentication based on previously seen public keys, a model similar to SSH authentication.
131 @anchor{gnutls-cli dane}
132 @subheading dane option
133 @cindex gnutls-cli-dane
135 This is the ``enable dane certificate verification (dnssec)'' option.
136 This option will, in addition to certificate authentication using 
137 the trusted CAs, verify the server certificates using on the DANE information
138 available via DNSSEC.
139 @anchor{gnutls-cli ca-verification}
140 @subheading ca-verification option
141 @cindex gnutls-cli-ca-verification
143 This is the ``disable ca certificate verification'' option.
145 @noindent
146 This option has some usage constraints.  It:
147 @itemize @bullet
148 @item
149 is enabled by default.
150 @end itemize
152 This option will disable CA certificate verification. It is to be used with the --dane or --tofu options.
153 @anchor{gnutls-cli ocsp}
154 @subheading ocsp option
155 @cindex gnutls-cli-ocsp
157 This is the ``enable ocsp certificate verification'' option.
158 This option will enable verification of the peer's certificate using ocsp
159 @anchor{gnutls-cli resume}
160 @subheading resume option (-r)
161 @cindex gnutls-cli-resume
163 This is the ``establish a session and resume'' option.
164 Connect, establish a session, reconnect and resume.
165 @anchor{gnutls-cli rehandshake}
166 @subheading rehandshake option (-e)
167 @cindex gnutls-cli-rehandshake
169 This is the ``establish a session and rehandshake'' option.
170 Connect, establish a session and rehandshake immediately.
171 @anchor{gnutls-cli ocsp-status-request}
172 @subheading ocsp-status-request option
173 @cindex gnutls-cli-ocsp-status-request
175 This is the ``enable ocsp status request'' option.
177 @noindent
178 This option has some usage constraints.  It:
179 @itemize @bullet
180 @item
181 is enabled by default.
182 @end itemize
184 The client will indicate to the server in a TLS extension that it wants a OCSP status request.
185 @anchor{gnutls-cli starttls}
186 @subheading starttls option (-s)
187 @cindex gnutls-cli-starttls
189 This is the ``connect, establish a plain session and start tls.'' option.
190 The TLS session will be initiated when EOF or a SIGALRM is received.
191 @anchor{gnutls-cli dh-bits}
192 @subheading dh-bits option
193 @cindex gnutls-cli-dh-bits
195 This is the ``the minimum number of bits allowed for dh'' option.
196 This option takes an argument number.
197 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.
198 @anchor{gnutls-cli priority}
199 @subheading priority option
200 @cindex gnutls-cli-priority
202 This is the ``priorities string'' option.
203 This option takes an argument string.
204 TLS algorithms and protocols to enable. You can
205 use predefined sets of ciphersuites such as PERFORMANCE,
206 NORMAL, SECURE128, SECURE256.
208 Check  the  GnuTLS  manual  on  section  ``Priority strings'' for more
209 information on allowed keywords
210 @anchor{gnutls-cli list}
211 @subheading list option (-l)
212 @cindex gnutls-cli-list
214 This is the ``print a list of the supported algorithms and modes'' option.
215 Print a list of the supported algorithms and modes. If a priority string is given then only the enabled ciphersuites are shown.
216 @anchor{gnutls-cli exit status}
217 @subheading gnutls-cli exit status
219 One of the following exit values will be returned:
220 @table @samp
221 @item 0 (EXIT_SUCCESS)
222 Successful program execution.
223 @item 1 (EXIT_FAILURE)
224 The operation failed or the command syntax was not valid.
225 @end table
226 @anchor{gnutls-cli See Also}
227 @subheading gnutls-cli See Also
228 gnutls-cli-debug(1), gnutls-serv(1)
230 @anchor{gnutls-cli Examples}
231 @subheading gnutls-cli Examples
232 @subheading Connecting using PSK authentication
233 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. 
234 @example
235 $ ./gnutls-cli -p 5556 localhost --pskusername psk_identity \
236     --pskkey 88f3824b3e5659f52d00e959bacab954b6540344 \
237     --priority NORMAL:-KX-ALL:+ECDHE-PSK:+DHE-PSK:+PSK
238 Resolving 'localhost'...
239 Connecting to '127.0.0.1:5556'...
240 - PSK authentication.
241 - Version: TLS1.1
242 - Key Exchange: PSK
243 - Cipher: AES-128-CBC
244 - MAC: SHA1
245 - Compression: NULL
246 - Handshake was completed
247     
248 - Simple Client Mode:
249 @end example
250 By keeping the --pskusername parameter and removing the --pskkey parameter, it will query only for the password during the handshake. 
252 @subheading Listing ciphersuites in a priority string
253 To list the ciphersuites in a priority string:
254 @example
255 $ ./gnutls-cli --priority SECURE192 -l
256 Cipher suites for SECURE192
257 TLS_ECDHE_ECDSA_AES_256_CBC_SHA384         0xc0, 0x24   TLS1.2
258 TLS_ECDHE_ECDSA_AES_256_GCM_SHA384         0xc0, 0x2e   TLS1.2
259 TLS_ECDHE_RSA_AES_256_GCM_SHA384           0xc0, 0x30   TLS1.2
260 TLS_DHE_RSA_AES_256_CBC_SHA256             0x00, 0x6b   TLS1.2
261 TLS_DHE_DSS_AES_256_CBC_SHA256             0x00, 0x6a   TLS1.2
262 TLS_RSA_AES_256_CBC_SHA256                 0x00, 0x3d   TLS1.2
264 Certificate types: CTYPE-X.509
265 Protocols: VERS-TLS1.2, VERS-TLS1.1, VERS-TLS1.0, VERS-SSL3.0, VERS-DTLS1.0
266 Compression: COMP-NULL
267 Elliptic curves: CURVE-SECP384R1, CURVE-SECP521R1
268 PK-signatures: SIGN-RSA-SHA384, SIGN-ECDSA-SHA384, SIGN-RSA-SHA512, SIGN-ECDSA-SHA512
269 @end example