Blame doc/invoke-gnutls-cli.texi

Packit 549fdc
@node gnutls-cli Invocation
Packit 549fdc
@section Invoking gnutls-cli
Packit 549fdc
@pindex gnutls-cli
Packit 549fdc
@ignore
Packit 549fdc
#  -*- buffer-read-only: t -*- vi: set ro:
Packit 549fdc
#
Packit 549fdc
# DO NOT EDIT THIS FILE   (invoke-gnutls-cli.texi)
Packit 549fdc
#
Packit 549fdc
# It has been AutoGen-ed
Packit 549fdc
# From the definitions    ../src/cli-args.def
Packit 549fdc
# and the template file   agtexi-cmd.tpl
Packit 549fdc
@end ignore
Packit 549fdc
Packit 549fdc
Packit 549fdc
Simple client program to set up a TLS connection to some other computer. 
Packit 549fdc
It sets up a TLS connection and forwards data from the standard input to the secured socket and vice versa.
Packit 549fdc
Packit 549fdc
This section was generated by @strong{AutoGen},
Packit 549fdc
using the @code{agtexi-cmd} template and the option descriptions for the @code{gnutls-cli} program.
Packit 549fdc
This software is released under the GNU General Public License, version 3 or later.
Packit 549fdc
Packit 549fdc
Packit 549fdc
@anchor{gnutls-cli usage}
Packit 549fdc
@subheading gnutls-cli help/usage (@option{--help})
Packit 549fdc
@cindex gnutls-cli help
Packit 549fdc
Packit 549fdc
This is the automatically generated usage text for gnutls-cli.
Packit 549fdc
Packit 549fdc
The text printed is the same whether selected with the @code{help} option
Packit 549fdc
(@option{--help}) or the @code{more-help} option (@option{--more-help}).  @code{more-help} will print
Packit 549fdc
the usage text by passing it through a pager program.
Packit 549fdc
@code{more-help} is disabled on platforms without a working
Packit 549fdc
@code{fork(2)} function.  The @code{PAGER} environment variable is
Packit 549fdc
used to select the program, defaulting to @file{more}.  Both will exit
Packit 549fdc
with a status code of 0.
Packit 549fdc
Packit 549fdc
@exampleindent 0
Packit 549fdc
@example
Packit 549fdc
gnutls-cli - GnuTLS client
Packit 549fdc
Usage:  gnutls-cli [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [hostname]
Packit 549fdc
Packit 549fdc
   -d, --debug=num            Enable debugging
Packit 549fdc
                                - it must be in the range:
Packit 549fdc
                                  0 to 9999
Packit 549fdc
   -V, --verbose              More verbose output
Packit 549fdc
                                - may appear multiple times
Packit 549fdc
       --tofu                 Enable trust on first use authentication
Packit 549fdc
                                - disabled as '--no-tofu'
Packit 549fdc
       --strict-tofu          Fail to connect if a known certificate has changed
Packit 549fdc
                                - disabled as '--no-strict-tofu'
Packit 549fdc
       --dane                 Enable DANE certificate verification (DNSSEC)
Packit 549fdc
                                - disabled as '--no-dane'
Packit 549fdc
       --local-dns            Use the local DNS server for DNSSEC resolving
Packit 549fdc
                                - disabled as '--no-local-dns'
Packit 549fdc
       --ca-verification      Enable CA certificate verification
Packit 549fdc
                                - disabled as '--no-ca-verification'
Packit 549fdc
                                - enabled by default
Packit 549fdc
       --ocsp                 Enable OCSP certificate verification
Packit 549fdc
                                - disabled as '--no-ocsp'
Packit 549fdc
   -r, --resume               Establish a session and resume
Packit 549fdc
   -e, --rehandshake          Establish a session and rehandshake
Packit 549fdc
       --sni-hostname=str     Server's hostname for server name indication extension
Packit 549fdc
   -s, --starttls             Connect, establish a plain session and start TLS
Packit 549fdc
       --app-proto=str        an alias for the 'starttls-proto' option
Packit 549fdc
       --starttls-proto=str   The application protocol to be used to obtain the server's certificate
Packit 549fdc
(https, ftp, smtp, imap, ldap, xmpp, lmtp, pop3, nntp, sieve, postgres)
Packit 549fdc
                                - prohibits the option 'starttls'
Packit 549fdc
   -u, --udp                  Use DTLS (datagram TLS) over UDP
Packit 549fdc
       --mtu=num              Set MTU for datagram TLS
Packit 549fdc
                                - it must be in the range:
Packit 549fdc
                                  0 to 17000
Packit 549fdc
       --crlf                 Send CR LF instead of LF
Packit 549fdc
       --fastopen             Enable TCP Fast Open
Packit 549fdc
       --x509fmtder           Use DER format for certificates to read from
Packit 549fdc
       --print-cert           Print peer's certificate in PEM format
Packit 549fdc
       --save-cert=str        Save the peer's certificate chain in the specified file in PEM format
Packit 549fdc
       --save-ocsp=str        Save the peer's OCSP status response in the provided file
Packit 549fdc
       --save-server-trace=str Save the server-side TLS message trace in the provided file
Packit 549fdc
       --save-client-trace=str Save the client-side TLS message trace in the provided file
Packit 549fdc
       --dh-bits=num          The minimum number of bits allowed for DH
Packit 549fdc
       --priority=str         Priorities string
Packit 549fdc
       --x509cafile=str       Certificate file or PKCS #11 URL to use
Packit 549fdc
       --x509crlfile=file     CRL file to use
Packit 549fdc
                                - file must pre-exist
Packit 549fdc
       --x509keyfile=str      X.509 key file or PKCS #11 URL to use
Packit 549fdc
       --x509certfile=str     X.509 Certificate file or PKCS #11 URL to use
Packit 549fdc
                                - requires the option 'x509keyfile'
Packit 549fdc
       --srpusername=str      SRP username to use
Packit 549fdc
       --srppasswd=str        SRP password to use
Packit 549fdc
       --pskusername=str      PSK username to use
Packit 549fdc
       --pskkey=str           PSK key (in hex) to use
Packit 549fdc
   -p, --port=str             The port or service to connect to
Packit 549fdc
       --insecure             Don't abort program if server certificate can't be validated
Packit 549fdc
       --verify-allow-broken  Allow broken algorithms, such as MD5 for certificate verification
Packit 549fdc
       --ranges               Use length-hiding padding to prevent traffic analysis
Packit 549fdc
       --benchmark-ciphers    Benchmark individual ciphers
Packit 549fdc
       --benchmark-tls-kx     Benchmark TLS key exchange methods
Packit 549fdc
       --benchmark-tls-ciphers  Benchmark TLS ciphers
Packit 549fdc
   -l, --list                 Print a list of the supported algorithms and modes
Packit 549fdc
                                - prohibits the option 'port'
Packit 549fdc
       --priority-list        Print a list of the supported priority strings
Packit 549fdc
       --noticket             Don't allow session tickets
Packit 549fdc
       --srtp-profiles=str    Offer SRTP profiles
Packit 549fdc
       --alpn=str             Application layer protocol
Packit 549fdc
                                - may appear multiple times
Packit 549fdc
   -b, --heartbeat            Activate heartbeat support
Packit 549fdc
       --recordsize=num       The maximum record size to advertize
Packit 549fdc
                                - it must be in the range:
Packit 549fdc
                                  0 to 4096
Packit 549fdc
       --disable-sni          Do not send a Server Name Indication (SNI)
Packit 549fdc
       --disable-extensions   Disable all the TLS extensions
Packit 549fdc
       --inline-commands      Inline commands of the form ^<cmd>^
Packit 549fdc
       --inline-commands-prefix=str Change the default delimiter for inline commands.
Packit 549fdc
       --provider=file        Specify the PKCS #11 provider library
Packit 549fdc
                                - file must pre-exist
Packit 549fdc
       --fips140-mode         Reports the status of the FIPS140-2 mode in gnutls library
Packit 549fdc
   -v, --version[=arg]        output version information and exit
Packit 549fdc
   -h, --help                 display extended usage information and exit
Packit 549fdc
   -!, --more-help            extended usage information passed thru pager
Packit 549fdc
Packit 549fdc
Options are specified by doubled hyphens and their name or by a single
Packit 549fdc
hyphen and the flag character.
Packit 549fdc
Operands and options may be intermixed.  They will be reordered.
Packit 549fdc
Packit 549fdc
Simple client program to set up a TLS connection to some other computer.  It
Packit 549fdc
sets up a TLS connection and forwards data from the standard input to the
Packit 549fdc
secured socket and vice versa.
Packit 549fdc
Packit 549fdc
@end example
Packit 549fdc
@exampleindent 4
Packit 549fdc
Packit 549fdc
@anchor{gnutls-cli debug}
Packit 549fdc
@subheading debug option (-d)
Packit 549fdc
Packit 549fdc
This is the ``enable debugging'' option.
Packit 549fdc
This option takes a number argument.
Packit 549fdc
Specifies the debug level.
Packit 549fdc
@anchor{gnutls-cli tofu}
Packit 549fdc
@subheading tofu option
Packit 549fdc
Packit 549fdc
This is the ``enable trust on first use authentication'' option.
Packit 549fdc
Packit 549fdc
@noindent
Packit 549fdc
This option has some usage constraints.  It:
Packit 549fdc
@itemize @bullet
Packit 549fdc
@item
Packit 549fdc
can be disabled with --no-tofu.
Packit 549fdc
@end itemize
Packit 549fdc
Packit 549fdc
This option will, in addition to certificate authentication, perform authentication
Packit 549fdc
based on previously seen public keys, a model similar to SSH authentication. Note that when tofu 
Packit 549fdc
is specified (PKI) and DANE authentication will become advisory to assist the public key acceptance
Packit 549fdc
process.
Packit 549fdc
@anchor{gnutls-cli strict-tofu}
Packit 549fdc
@subheading strict-tofu option
Packit 549fdc
Packit 549fdc
This is the ``fail to connect if a known certificate has changed'' option.
Packit 549fdc
Packit 549fdc
@noindent
Packit 549fdc
This option has some usage constraints.  It:
Packit 549fdc
@itemize @bullet
Packit 549fdc
@item
Packit 549fdc
can be disabled with --no-strict-tofu.
Packit 549fdc
@end itemize
Packit 549fdc
Packit 549fdc
This option will perform authentication as with option --tofu; however, while --tofu asks whether to trust a changed public key, this option will fail in case of public key changes.
Packit 549fdc
@anchor{gnutls-cli dane}
Packit 549fdc
@subheading dane option
Packit 549fdc
Packit 549fdc
This is the ``enable dane certificate verification (dnssec)'' option.
Packit 549fdc
Packit 549fdc
@noindent
Packit 549fdc
This option has some usage constraints.  It:
Packit 549fdc
@itemize @bullet
Packit 549fdc
@item
Packit 549fdc
can be disabled with --no-dane.
Packit 549fdc
@end itemize
Packit 549fdc
Packit 549fdc
This option will, in addition to certificate authentication using 
Packit 549fdc
the trusted CAs, verify the server certificates using on the DANE information
Packit 549fdc
available via DNSSEC.
Packit 549fdc
@anchor{gnutls-cli local-dns}
Packit 549fdc
@subheading local-dns option
Packit 549fdc
Packit 549fdc
This is the ``use the local dns server for dnssec resolving'' option.
Packit 549fdc
Packit 549fdc
@noindent
Packit 549fdc
This option has some usage constraints.  It:
Packit 549fdc
@itemize @bullet
Packit 549fdc
@item
Packit 549fdc
can be disabled with --no-local-dns.
Packit 549fdc
@end itemize
Packit 549fdc
Packit 549fdc
This option will use the local DNS server for DNSSEC.
Packit 549fdc
This is disabled by default due to many servers not allowing DNSSEC.
Packit 549fdc
@anchor{gnutls-cli ca-verification}
Packit 549fdc
@subheading ca-verification option
Packit 549fdc
Packit 549fdc
This is the ``enable ca certificate verification'' option.
Packit 549fdc
Packit 549fdc
@noindent
Packit 549fdc
This option has some usage constraints.  It:
Packit 549fdc
@itemize @bullet
Packit 549fdc
@item
Packit 549fdc
can be disabled with --no-ca-verification.
Packit 549fdc
@item
Packit 549fdc
It is enabled by default.
Packit 549fdc
@end itemize
Packit 549fdc
Packit 549fdc
This option can be used to enable or disable CA certificate verification. It is to be used with the --dane or --tofu options.
Packit 549fdc
@anchor{gnutls-cli ocsp}
Packit 549fdc
@subheading ocsp option
Packit 549fdc
Packit 549fdc
This is the ``enable ocsp certificate verification'' option.
Packit 549fdc
Packit 549fdc
@noindent
Packit 549fdc
This option has some usage constraints.  It:
Packit 549fdc
@itemize @bullet
Packit 549fdc
@item
Packit 549fdc
can be disabled with --no-ocsp.
Packit 549fdc
@end itemize
Packit 549fdc
Packit 549fdc
This option will enable verification of the peer's certificate using ocsp
Packit 549fdc
@anchor{gnutls-cli resume}
Packit 549fdc
@subheading resume option (-r)
Packit 549fdc
Packit 549fdc
This is the ``establish a session and resume'' option.
Packit 549fdc
Connect, establish a session, reconnect and resume.
Packit 549fdc
@anchor{gnutls-cli rehandshake}
Packit 549fdc
@subheading rehandshake option (-e)
Packit 549fdc
Packit 549fdc
This is the ``establish a session and rehandshake'' option.
Packit 549fdc
Connect, establish a session and rehandshake immediately.
Packit 549fdc
@anchor{gnutls-cli sni-hostname}
Packit 549fdc
@subheading sni-hostname option
Packit 549fdc
Packit 549fdc
This is the ``server's hostname for server name indication extension'' option.
Packit 549fdc
This option takes a string argument.
Packit 549fdc
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.
Packit 549fdc
@anchor{gnutls-cli starttls}
Packit 549fdc
@subheading starttls option (-s)
Packit 549fdc
Packit 549fdc
This is the ``connect, establish a plain session and start tls'' option.
Packit 549fdc
The TLS session will be initiated when EOF or a SIGALRM is received.
Packit 549fdc
@anchor{gnutls-cli app-proto}
Packit 549fdc
@subheading app-proto option
Packit 549fdc
Packit 549fdc
This is an alias for the @code{starttls-proto} option,
Packit 549fdc
@pxref{gnutls-cli starttls-proto, the starttls-proto option documentation}.
Packit 549fdc
Packit 549fdc
@anchor{gnutls-cli starttls-proto}
Packit 549fdc
@subheading starttls-proto option
Packit 549fdc
Packit 549fdc
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.
Packit 549fdc
This option takes a string argument.
Packit 549fdc
Packit 549fdc
@noindent
Packit 549fdc
This option has some usage constraints.  It:
Packit 549fdc
@itemize @bullet
Packit 549fdc
@item
Packit 549fdc
must not appear in combination with any of the following options:
Packit 549fdc
starttls.
Packit 549fdc
@end itemize
Packit 549fdc
Packit 549fdc
Specify the application layer protocol for STARTTLS. If the protocol is supported, gnutls-cli will proceed to the TLS negotiation.
Packit 549fdc
@anchor{gnutls-cli dh-bits}
Packit 549fdc
@subheading dh-bits option
Packit 549fdc
Packit 549fdc
This is the ``the minimum number of bits allowed for dh'' option.
Packit 549fdc
This option takes a number argument.
Packit 549fdc
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 549fdc
@anchor{gnutls-cli priority}
Packit 549fdc
@subheading priority option
Packit 549fdc
Packit 549fdc
This is the ``priorities string'' option.
Packit 549fdc
This option takes a string argument.
Packit 549fdc
TLS algorithms and protocols to enable. You can
Packit 549fdc
use predefined sets of ciphersuites such as PERFORMANCE,
Packit 549fdc
NORMAL, PFS, SECURE128, SECURE256. The default is NORMAL.
Packit 549fdc
Packit 549fdc
Check  the  GnuTLS  manual  on  section  ``Priority strings'' for more
Packit 549fdc
information on the allowed keywords
Packit 549fdc
@anchor{gnutls-cli ranges}
Packit 549fdc
@subheading ranges option
Packit 549fdc
Packit 549fdc
This is the ``use length-hiding padding to prevent traffic analysis'' option.
Packit 549fdc
When possible (e.g., when using CBC ciphersuites), use length-hiding padding to prevent traffic analysis.
Packit 549fdc
@anchor{gnutls-cli benchmark-ciphers}
Packit 549fdc
@subheading benchmark-ciphers option
Packit 549fdc
Packit 549fdc
This is the ``benchmark individual ciphers'' option.
Packit 549fdc
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 549fdc
@anchor{gnutls-cli benchmark-tls-ciphers}
Packit 549fdc
@subheading benchmark-tls-ciphers option
Packit 549fdc
Packit 549fdc
This is the ``benchmark tls ciphers'' option.
Packit 549fdc
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 549fdc
@anchor{gnutls-cli list}
Packit 549fdc
@subheading list option (-l)
Packit 549fdc
Packit 549fdc
This is the ``print a list of the supported algorithms and modes'' option.
Packit 549fdc
Packit 549fdc
@noindent
Packit 549fdc
This option has some usage constraints.  It:
Packit 549fdc
@itemize @bullet
Packit 549fdc
@item
Packit 549fdc
must not appear in combination with any of the following options:
Packit 549fdc
port.
Packit 549fdc
@end itemize
Packit 549fdc
Packit 549fdc
Print a list of the supported algorithms and modes. If a priority string is given then only the enabled ciphersuites are shown.
Packit 549fdc
@anchor{gnutls-cli priority-list}
Packit 549fdc
@subheading priority-list option
Packit 549fdc
Packit 549fdc
This is the ``print a list of the supported priority strings'' option.
Packit 549fdc
Print a list of the supported priority strings. The ciphersuites corresponding to each priority string can be examined using -l -p.
Packit 549fdc
@anchor{gnutls-cli alpn}
Packit 549fdc
@subheading alpn option
Packit 549fdc
Packit 549fdc
This is the ``application layer protocol'' option.
Packit 549fdc
This option takes a string argument.
Packit 549fdc
Packit 549fdc
@noindent
Packit 549fdc
This option has some usage constraints.  It:
Packit 549fdc
@itemize @bullet
Packit 549fdc
@item
Packit 549fdc
may appear an unlimited number of times.
Packit 549fdc
@end itemize
Packit 549fdc
Packit 549fdc
This option will set and enable the Application Layer Protocol Negotiation  (ALPN) in the TLS protocol.
Packit 549fdc
@anchor{gnutls-cli disable-extensions}
Packit 549fdc
@subheading disable-extensions option
Packit 549fdc
Packit 549fdc
This is the ``disable all the tls extensions'' option.
Packit 549fdc
This option disables all TLS extensions. Deprecated option. Use the priority string.
Packit 549fdc
@anchor{gnutls-cli inline-commands}
Packit 549fdc
@subheading inline-commands option
Packit 549fdc
Packit 549fdc
This is the ``inline commands of the form ^<cmd>^'' option.
Packit 549fdc
Enable inline commands of the form ^<cmd>^. The inline commands are expected to be in a line by themselves. The available commands are: resume and renegotiate.
Packit 549fdc
@anchor{gnutls-cli inline-commands-prefix}
Packit 549fdc
@subheading inline-commands-prefix option
Packit 549fdc
Packit 549fdc
This is the ``change the default delimiter for inline commands.'' option.
Packit 549fdc
This option takes a string argument.
Packit 549fdc
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 549fdc
@anchor{gnutls-cli provider}
Packit 549fdc
@subheading provider option
Packit 549fdc
Packit 549fdc
This is the ``specify the pkcs #11 provider library'' option.
Packit 549fdc
This option takes a file argument.
Packit 549fdc
This will override the default options in /etc/gnutls/pkcs11.conf
Packit 549fdc
@anchor{gnutls-cli exit status}
Packit 549fdc
@subheading gnutls-cli exit status
Packit 549fdc
Packit 549fdc
One of the following exit values will be returned:
Packit 549fdc
@table @samp
Packit 549fdc
@item 0 (EXIT_SUCCESS)
Packit 549fdc
Successful program execution.
Packit 549fdc
@item 1 (EXIT_FAILURE)
Packit 549fdc
The operation failed or the command syntax was not valid.
Packit 549fdc
@end table
Packit 549fdc
@anchor{gnutls-cli See Also}
Packit 549fdc
@subheading gnutls-cli See Also
Packit 549fdc
gnutls-cli-debug(1), gnutls-serv(1)
Packit 549fdc
@anchor{gnutls-cli Examples}
Packit 549fdc
@subheading gnutls-cli Examples
Packit 549fdc
@subheading Connecting using PSK authentication
Packit 549fdc
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 549fdc
@example
Packit 549fdc
$ ./gnutls-cli -p 5556 localhost --pskusername psk_identity \
Packit 549fdc
    --pskkey 88f3824b3e5659f52d00e959bacab954b6540344 \
Packit 549fdc
    --priority NORMAL:-KX-ALL:+ECDHE-PSK:+DHE-PSK:+PSK
Packit 549fdc
Resolving 'localhost'...
Packit 549fdc
Connecting to '127.0.0.1:5556'...
Packit 549fdc
- PSK authentication.
Packit 549fdc
- Version: TLS1.1
Packit 549fdc
- Key Exchange: PSK
Packit 549fdc
- Cipher: AES-128-CBC
Packit 549fdc
- MAC: SHA1
Packit 549fdc
- Compression: NULL
Packit 549fdc
- Handshake was completed
Packit 549fdc
    
Packit 549fdc
- Simple Client Mode:
Packit 549fdc
@end example
Packit 549fdc
By keeping the --pskusername parameter and removing the --pskkey parameter, it will query only for the password during the handshake. 
Packit 549fdc
Packit 549fdc
@subheading Connecting to STARTTLS services
Packit 549fdc
Packit 549fdc
You could also use the client to connect to services with starttls capability.
Packit 549fdc
@example
Packit 549fdc
$ gnutls-cli --starttls-proto smtp --port 25 localhost
Packit 549fdc
@end example
Packit 549fdc
Packit 549fdc
@subheading Listing ciphersuites in a priority string
Packit 549fdc
To list the ciphersuites in a priority string:
Packit 549fdc
@example
Packit 549fdc
$ ./gnutls-cli --priority SECURE192 -l
Packit 549fdc
Cipher suites for SECURE192
Packit 549fdc
TLS_ECDHE_ECDSA_AES_256_CBC_SHA384         0xc0, 0x24	TLS1.2
Packit 549fdc
TLS_ECDHE_ECDSA_AES_256_GCM_SHA384         0xc0, 0x2e	TLS1.2
Packit 549fdc
TLS_ECDHE_RSA_AES_256_GCM_SHA384           0xc0, 0x30	TLS1.2
Packit 549fdc
TLS_DHE_RSA_AES_256_CBC_SHA256             0x00, 0x6b	TLS1.2
Packit 549fdc
TLS_DHE_DSS_AES_256_CBC_SHA256             0x00, 0x6a	TLS1.2
Packit 549fdc
TLS_RSA_AES_256_CBC_SHA256                 0x00, 0x3d	TLS1.2
Packit 549fdc
Packit 549fdc
Certificate types: CTYPE-X.509
Packit 549fdc
Protocols: VERS-TLS1.2, VERS-TLS1.1, VERS-TLS1.0, VERS-SSL3.0, VERS-DTLS1.0
Packit 549fdc
Compression: COMP-NULL
Packit 549fdc
Elliptic curves: CURVE-SECP384R1, CURVE-SECP521R1
Packit 549fdc
PK-signatures: SIGN-RSA-SHA384, SIGN-ECDSA-SHA384, SIGN-RSA-SHA512, SIGN-ECDSA-SHA512
Packit 549fdc
@end example
Packit 549fdc
Packit 549fdc
@subheading Connecting using a PKCS #11 token
Packit 549fdc
To connect to a server using a certificate and a private key present in a PKCS #11 token you 
Packit 549fdc
need to substitute the PKCS 11 URLs in the x509certfile and x509keyfile parameters.
Packit 549fdc
Packit 549fdc
Those can be found using "p11tool --list-tokens" and then listing all the objects in the
Packit 549fdc
needed token, and using the appropriate.
Packit 549fdc
@example
Packit 549fdc
$ p11tool --list-tokens
Packit 549fdc
Packit 549fdc
Token 0:
Packit 549fdc
URL: pkcs11:model=PKCS15;manufacturer=MyMan;serial=1234;token=Test
Packit 549fdc
Label: Test
Packit 549fdc
Manufacturer: EnterSafe
Packit 549fdc
Model: PKCS15
Packit 549fdc
Serial: 1234
Packit 549fdc
Packit 549fdc
$ p11tool --login --list-certs "pkcs11:model=PKCS15;manufacturer=MyMan;serial=1234;token=Test"
Packit 549fdc
Packit 549fdc
Object 0:
Packit 549fdc
URL: pkcs11:model=PKCS15;manufacturer=MyMan;serial=1234;token=Test;object=client;type=cert
Packit 549fdc
Type: X.509 Certificate
Packit 549fdc
Label: client
Packit 549fdc
ID: 2a:97:0d:58:d1:51:3c:23:07:ae:4e:0d:72:26:03:7d:99:06:02:6a
Packit 549fdc
Packit 549fdc
$ MYCERT="pkcs11:model=PKCS15;manufacturer=MyMan;serial=1234;token=Test;object=client;type=cert"
Packit 549fdc
$ MYKEY="pkcs11:model=PKCS15;manufacturer=MyMan;serial=1234;token=Test;object=client;type=private"
Packit 549fdc
$ export MYCERT MYKEY
Packit 549fdc
Packit 549fdc
$ gnutls-cli www.example.com --x509keyfile $MYKEY --x509certfile $MYCERT
Packit 549fdc
@end example
Packit 549fdc
Notice that the private key only differs from the certificate in the type.