summaryrefslogtreecommitdiff
path: root/doc/invoke-gnutls-cli.texi
blob: 977f69d42833c8b6f8054973fd890602a3412389 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
@node gnutls-cli Invocation
@section Invoking gnutls-cli
@pindex gnutls-cli
@cindex GnuTLS client
@ignore
#  -*- buffer-read-only: t -*- vi: set ro:
# 
# DO NOT EDIT THIS FILE   (invoke-gnutls-cli.texi)
# 
# It has been AutoGen-ed  September  2, 2012 at 08:04:10 PM by AutoGen 5.16
# From the definitions    ../src/cli-args.def
# and the template file   agtexi-cmd.tpl
@end ignore


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.

This section was generated by @strong{AutoGen},
using the @code{agtexi-cmd} template and the option descriptions for the @code{gnutls-cli} program.
This software is released under the GNU General Public License, version 3 or later.


@anchor{gnutls-cli usage}
@subheading gnutls-cli help/usage (-h)
@cindex gnutls-cli help

This is the automatically generated usage text for gnutls-cli.
The text printed is the same whether for the @code{help} option (-h) or the @code{more-help} option (-!).  @code{more-help} will print
the usage text by passing it through a pager program.
@code{more-help} is disabled on platforms without a working
@code{fork(2)} function.  The @code{PAGER} environment variable is
used to select the program, defaulting to @file{more}.  Both will exit
with a status code of 0.

@exampleindent 0
@example
gnutls-cli - GnuTLS client - Ver. @@VERSION@@
USAGE:  gnutls-cli [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [hostname]

   -d, --debug=num            Enable debugging.
                                - It must be in the range:
                                  0 to 9999
   -V, --verbose              More verbose output
                                - may appear multiple times
       --tofu                 Enable trust on first use authentication
                                - disabled as --no-tofu
       --ocsp                 Enable OCSP certificate verification
                                - disabled as --no-ocsp
   -r, --resume               Establish a session and resume
   -b, --heartbeat            Activate heartbeat support
   -e, --rehandshake          Establish a session and rehandshake
       --noticket             Don't accept session tickets
   -s, --starttls             Connect, establish a plain session and start TLS.
   -u, --udp                  Use DTLS (datagram TLS) over UDP
       --mtu=num              Set MTU for datagram TLS
                                - It must be in the range:
                                  0 to 17000
       --crlf                 Send CR LF instead of LF
       --x509fmtder           Use DER format for certificates to read from
   -f, --fingerprint          Send the openpgp fingerprint, instead of the key
       --disable-extensions   Disable all the TLS extensions
       --print-cert           Print peer's certificate in PEM format
       --recordsize=num       The maximum record size to advertize
                                - It must be in the range:
                                  0 to 4096
       --dh-bits=num          The minimum number of bits allowed for DH
       --priority=str         Priorities string
       --x509cafile=str       Certificate file or PKCS #11 URL to use
       --x509crlfile=file     CRL file to use
                                - file must pre-exist
       --pgpkeyfile=file      PGP Key file to use
                                - file must pre-exist
       --pgpkeyring=file      PGP Key ring file to use
                                - file must pre-exist
       --pgpcertfile=file     PGP Public Key (certificate) file to use
                                - file must pre-exist
       --x509keyfile=str      X.509 key file or PKCS #11 URL to use
       --x509certfile=str     X.509 Certificate file or PKCS #11 URL to use
       --pgpsubkey=str        PGP subkey to use (hex or auto)
       --srpusername=str      SRP username to use
       --srppasswd=str        SRP password to use
       --pskusername=str      PSK username to use
       --pskkey=str           PSK key (in hex) to use
   -p, --port=str             The port or service to connect to
       --insecure             Don't abort program if server certificate can't be validated
       --benchmark-ciphers    Benchmark individual ciphers
       --benchmark-soft-ciphers  Benchmark individual software ciphers (no hw acceleration)
       --benchmark-tls-kx     Benchmark TLS key exchange methods
       --benchmark-tls-ciphers  Benchmark TLS ciphers
   -l, --list                 Print a list of the supported algorithms and modes
   -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.
Operands and options may be intermixed.  They will be reordered.



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.

please send bug reports to:  bug-gnutls@@gnu.org
@end example
@exampleindent 4

@anchor{gnutls-cli debug}
@subheading debug option (-d)
@cindex gnutls-cli-debug

This is the ``enable debugging.'' option.
This option takes an argument number.
Specifies the debug level.
@anchor{gnutls-cli tofu}
@subheading tofu option
@cindex gnutls-cli-tofu

This is the ``enable trust on first use authentication'' option.
This option will, in addition to certificate authentication, perform authentication based on previously seen public keys, a model similar to SSH authentication.
@anchor{gnutls-cli ocsp}
@subheading ocsp option
@cindex gnutls-cli-ocsp

This is the ``enable ocsp certificate verification'' option.
This option will enable verification of the peer's certificate using ocsp
@anchor{gnutls-cli resume}
@subheading resume option (-r)
@cindex gnutls-cli-resume

This is the ``establish a session and resume'' option.
Connect, establish a session, reconnect and resume.
@anchor{gnutls-cli rehandshake}
@subheading rehandshake option (-e)
@cindex gnutls-cli-rehandshake

This is the ``establish a session and rehandshake'' option.
Connect, establish a session and rehandshake immediately.
@anchor{gnutls-cli starttls}
@subheading starttls option (-s)
@cindex gnutls-cli-starttls

This is the ``connect, establish a plain session and start tls.'' option.
The TLS session will be initiated when EOF or a SIGALRM is received.
@anchor{gnutls-cli dh-bits}
@subheading dh-bits option
@cindex gnutls-cli-dh-bits

This is the ``the minimum number of bits allowed for dh'' option.
This option takes an argument number.
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.
@anchor{gnutls-cli priority}
@subheading priority option
@cindex gnutls-cli-priority

This is the ``priorities string'' option.
This option takes an argument string.
TLS algorithms and protocols to enable. You can
use predefined sets of ciphersuites such as PERFORMANCE,
NORMAL, SECURE128, SECURE256.

Check  the  GnuTLS  manual  on  section  ``Priority strings'' for more
information on allowed keywords
@anchor{gnutls-cli list}
@subheading list option (-l)
@cindex gnutls-cli-list

This is the ``print a list of the supported algorithms and modes'' option.
Print a list of the supported algorithms and modes. If a priority string is given then only the enabled ciphersuites are shown.
@anchor{gnutls-cli exit status}
@subheading gnutls-cli exit status

One of the following exit values will be returned:
@table @samp
@item 0 (EXIT_SUCCESS)
Successful program execution.
@item 1 (EXIT_FAILURE)
The operation failed or the command syntax was not valid.
@end table
@anchor{gnutls-cli See Also}
@subheading gnutls-cli See Also
gnutls-cli-debug(1), gnutls-serv(1)

@anchor{gnutls-cli Examples}
@subheading gnutls-cli Examples
@subheading Connecting using PSK authentication
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. 
@example
$ ./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:
@end example
By keeping the --pskusername parameter and removing the --pskkey parameter, it will query only for the password during the handshake. 

@subheading Listing ciphersuites in a priority string
To list the ciphersuites in a priority string:
@example
$ ./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

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
@end example