gnutls-cli - GnuTLS client
Usage: gnutls-cli [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [hostname]
None:
-d, --debug=num Enable debugging
- it must be in the range:
0 to 9999
-V, --verbose More verbose output
--tofu Enable trust on first use authentication
--strict-tofu Fail to connect if a certificate is unknown or a known certificate has changed
--dane Enable DANE certificate verification (DNSSEC)
--local-dns Use the local DNS server for DNSSEC resolving
--ca-verification Enable CA certificate verification
- enabled by default
- disabled as '--no-ca-verification'
--ocsp Enable OCSP certificate verification
-r, --resume Establish a session and resume
--earlydata=str Send early data on resumption from the specified file
-e, --rehandshake Establish a session and rehandshake
--sni-hostname=str Server's hostname for server name indication extension
--verify-hostname=str Server's hostname to use for validation
-s, --starttls Connect, establish a plain session and start TLS
--app-proto an alias for the 'starttls-proto' option
--starttls-proto=str The application protocol to be used to obtain the server's certificate (https, ftp, smtp, imap, ldap, xmpp, lmtp, pop3, nntp, sieve, postgres)
- prohibits the option 'starttls'
--starttls-name=str The hostname presented to the application protocol for STARTTLS (for smtp, xmpp, lmtp)
- prohibits the option 'starttls'
- requires the option 'starttls-proto'
-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
--fastopen Enable TCP Fast Open
--x509fmtder Use DER format for certificates to read from
--print-cert Print peer's certificate in PEM format
--save-cert=str Save the peer's certificate chain in the specified file in PEM format
--save-ocsp=str Save the peer's OCSP status response in the provided file
- prohibits the option 'save-ocsp-multi'
--save-ocsp-multi=str Save all OCSP responses provided by the peer in this file
- prohibits the option 'save-ocsp'
--save-server-trace=str Save the server-side TLS message trace in the provided file
--save-client-trace=str Save the client-side TLS message trace in the provided file
--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
--x509keyfile=str X.509 key file or PKCS #11 URL to use
--x509certfile=str X.509 Certificate file or PKCS #11 URL to use
- requires the option 'x509keyfile'
--rawpkkeyfile=str Private key file (PKCS #8 or PKCS #12) or PKCS #11 URL to use
--rawpkfile=str Raw public-key file to use
- requires the option 'rawpkkeyfile'
--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
--verify-allow-broken Allow broken algorithms, such as MD5 for certificate verification
--benchmark-ciphers Benchmark individual ciphers
--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
- prohibits the option 'port'
--priority-list Print a list of the supported priority strings
--noticket Don't allow session tickets
--srtp-profiles=str Offer SRTP profiles
--alpn=str Application layer protocol
--compress-cert=str Compress certificate
-b, --heartbeat Activate heartbeat support
--recordsize=num The maximum record size to advertise
- it must be in the range:
0 to 4096
--disable-sni Do not send a Server Name Indication (SNI)
--single-key-share Send a single key share under TLS1.3
--post-handshake-auth Enable post-handshake authentication under TLS1.3
--inline-commands Inline commands of the form ^<cmd>^
--inline-commands-prefix=str Change the default delimiter for inline commands
--provider=file Specify the PKCS #11 provider library
- file must pre-exist
--fips140-mode Reports the status of the FIPS140-2 mode in gnutls library
--list-config Reports the configuration of the library
--logfile=str Redirect informational messages to a specific file
--keymatexport=str Label used for exporting keying material
--keymatexportsize=num Size of the exported keying material
--waitresumption Block waiting for the resumption data under TLS1.3
--ca-auto-retrieve Enable automatic retrieval of missing CA certificates
--attime=str Perform validation at the timestamp instead of the system time
Version, usage and configuration options:
-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.
Note that this program is only meant for testing and diagnostic purposes. For more practical use-cases, consider using alternatives like GNU Wget.
Please send bug reports to: <bugs@gnutls.org>
Options (73)
| Option | Description | Source |
|---|---|---|
-d, --debug num | Enable debugging. | help + man |
-V, --verbose | More verbose output. | help + man |
--tofu, --no-tofu | Enable trust on first use authentication. | help + man |
--strict-tofu, --no-strict-tofu | Fail to connect if a certificate is unknown or a known certificate has changed. | help + man |
--dane, --no-dane | Enable DANE certificate verification (DNSSEC). | help + man |
--local-dns, --no-local-dns | Use the local DNS server for DNSSEC resolving. | help + man |
--ca-verification, --no-ca-verification | Enable CA certificate verification. | help + man |
--ocsp, --no-ocsp | Enable OCSP certificate verification. | help + man |
-r, --resume | Establish a session and resume. | help + man |
--earlydata str | Send early data on resumption from the specified file. | help + man |
-e, --rehandshake | Establish a session and rehandshake. | help + man |
--sni-hostname str | Server's hostname for server name indication extension. | help + man |
--verify-hostname str | Server's hostname to use for validation. | help + man |
-s, --starttls | Connect, establish a plain session and start TLS. | help + man |
--app-proto | This is an alias for the --starttls-proto option. | help + man |
--starttls-proto str | The application protocol to be used to obtain the server's certificate (https, ftp, smtp, imap, ldap, xmpp, lmtp, pop3, nntp, sieve, postgres). | help + man |
--starttls-name str | The hostname presented to the application protocol for STARTTLS (for smtp, xmpp, lmtp). | help + man |
-u, --udp | Use DTLS (datagram TLS) over UDP. | help + man |
--mtu num | Set MTU for datagram TLS. | help + man |
--crlf | Send CR LF instead of LF. | help + man |
--fastopen | Enable TCP Fast Open. | help + man |
--x509fmtder | Use DER format for certificates to read from. | help + man |
--print-cert | Print peer's certificate in PEM format. | help + man |
--save-cert str | Save the peer's certificate chain in the specified file in PEM format. | help + man |
--save-ocsp str | Save the peer's OCSP status response in the provided file. | help + man |
--save-ocsp-multi str | Save all OCSP responses provided by the peer in this file. | help + man |
--dh-bits num | The minimum number of bits allowed for DH. | help + man |
--priority str | Priorities string. | help + man |
--x509cafile str | Certificate file or PKCS #11 URL to use. | help + man |
--x509crlfile file | CRL file to use. | help + man |
--x509keyfile str | X.509 key file or PKCS #11 URL to use. | help + man |
--x509certfile str | X.509 Certificate file or PKCS #11 URL to use. | help + man |
--rawpkkeyfile str | Private key file (PKCS #8 or PKCS #12) or PKCS #11 URL to use. | help + man |
--rawpkfile str | Raw public-key file to use. | help + man |
--srpusername str | SRP username to use. | help + man |
--srppasswd str | SRP password to use. | help + man |
--pskusername str | PSK username to use. | help + man |
--pskkey str | PSK key (in hex) to use. | help + man |
-p, --port str | The port or service to connect to. | help + man |
--insecure | Don't abort program if server certificate can't be validated. | help + man |
--verify-allow-broken | Allow broken algorithms, such as MD5 for certificate verification. | help + man |
--benchmark-ciphers | Benchmark individual ciphers. | help + man |
--benchmark-tls-kx | Benchmark TLS key exchange methods. | help + man |
--benchmark-tls-ciphers | Benchmark TLS ciphers. | help + man |
-l, --list | Print a list of the supported algorithms and modes. | help + man |
--priority-list | Print a list of the supported priority strings. | help + man |
--noticket | Don't allow session tickets. | help + man |
--srtp-profiles str | Offer SRTP profiles. | help + man |
--alpn str | Application layer protocol. | help + man |
--compress-cert str | Compress certificate. | help + man |
-b, --heartbeat | Activate heartbeat support. | help + man |
--recordsize num | The maximum record size to advertise. | help + man |
--disable-sni | Do not send a Server Name Indication (SNI). | help + man |
--single-key-share | Send a single key share under TLS1.3. | help + man |
--post-handshake-auth | Enable post-handshake authentication under TLS1.3. | help + man |
--inline-commands | Inline commands of the form ^<cmd>^. | help + man |
--provider file | Specify the PKCS #11 provider library. | help + man |
--fips140-mode | Reports the status of the FIPS140-2 mode in gnutls library. | help + man |
--list-config | Reports the configuration of the library. | help + man |
--logfile str | Redirect informational messages to a specific file. | help + man |
--keymatexport str | Label used for exporting keying material. | help + man |
--waitresumption | Block waiting for the resumption data under TLS1.3. | help + man |
--ca-auto-retrieve, --no-ca-auto-retrieve | Enable automatic retrieval of missing CA certificates. | help + man |
--attime str | Perform validation at the timestamp instead of the system time. | help + man |
-v, --version arg | output version information and exit | help + man |
-h, --help | display extended usage information and exit | help + man |
--more-help | Pass the extended usage information through a pager. | help + man |
--save-server-trace str | Save the server-side TLS message trace in the provided file. (in the manual page but not in --help) | man |
--save-client-trace str | Save the client-side TLS message trace in the provided file. (in the manual page but not in --help) | man |
--ranges | Use length-hiding padding to prevent traffic analysis. (in the manual page but not in --help) | man |
--disable-extensions | Disable all the TLS extensions. (in the manual page but not in --help) | man |
--inline-commands-prefix str | Change the default delimiter for inline commands. (in the manual page but not in --help) | man |
--keymatexportsize num | Size of the exported keying material. (in the manual page but not in --help) | man |
Examples (10) from the manual page, untested
./gnutls-cli -p 5556 localhost --pskusername psk_identity --pskkey 88f3824b3e5659f52d00e959bacab954b6540344 --priority NORMAL:-KX-ALL:+ECDHE-PSK:+DHE-PSK:+PSK
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../gnutls-cli -p 5556 localhost --priority NORMAL:-CTYPE-CLI-ALL:+CTYPE-CLI-RAWPK --rawpkkeyfile cli.key.pem --rawpkfile cli.rawpk.pem
Connecting using raw public-key authentication 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…gnutls-cli --starttls-proto smtp --port 25 localhost
You could also use the client to connect to services with starttls capability../gnutls-cli --priority SECURE192 -l
Listing ciphersuites in a priority string To list the ciphersuites in a priority string:p11tool --list-tokens
Those can be found using "p11tool --list-tokens" and then listing all the objects in the needed token, and using the appropriate.p11tool --login --list-certs "pkcs11:model=PKCS15;manufacturer=MyMan;serial=1234;token=Test"
Those can be found using "p11tool --list-tokens" and then listing all the objects in the needed token, and using the appropriate.MYCERT="pkcs11:model=PKCS15;manufacturer=MyMan;serial=1234;token=Test;object=client;type=cert"
Those can be found using "p11tool --list-tokens" and then listing all the objects in the needed token, and using the appropriate.MYKEY="pkcs11:model=PKCS15;manufacturer=MyMan;serial=1234;token=Test;object=client;type=private"
Those can be found using "p11tool --list-tokens" and then listing all the objects in the needed token, and using the appropriate.export MYCERT MYKEY
Those can be found using "p11tool --list-tokens" and then listing all the objects in the needed token, and using the appropriate.gnutls-cli www.example.com --x509keyfile $MYKEY --x509certfile $MYCERT
Those can be found using "p11tool --list-tokens" and then listing all the objects in the needed token, and using the appropriate.