LinuxCommandLibrary

gnutls-cli

TLDR

Connect to TLS server

$ gnutls-cli [example.com]
copy
Connect on specific port
$ gnutls-cli -p [443] [example.com]
copy
Show certificate chain
$ gnutls-cli --print-cert [example.com]
copy
Test with specific protocol
$ gnutls-cli --priority="NORMAL:-VERS-TLS-ALL:+VERS-TLS1.3" [example.com]
copy
Start with STARTTLS
$ gnutls-cli --starttls-proto=[smtp] [mail.example.com]:587
copy
Verify certificate only
$ gnutls-cli --tofu [example.com] < /dev/null
copy

SYNOPSIS

gnutls-cli [options] hostname

DESCRIPTION

gnutls-cli is a TLS/SSL client for testing and debugging secure connections. It connects to servers, displays certificate information, and allows testing of various TLS configurations.
The tool helps diagnose certificate issues, protocol support, and cipher suite negotiation. It can also serve as a simple secure client for interactive protocols.

PARAMETERS

-p port

Connect to port.
--print-cert
Print server certificate.
--starttls-proto proto
Use STARTTLS (smtp, pop3, imap, ftp, xmpp, ldap).
--priority string
Priority string for cipher selection.
-V, --verbose
Verbose output.
--tofu
Trust on first use.
--insecure
Don't verify certificate.
-x, --x509cafile file
CA certificate file.
--benchmark-ciphers
Benchmark cipher performance.
--list
List supported algorithms.

CAVEATS

Certificate verification requires proper CA setup. Priority string syntax complex. Some servers may behave differently with test clients.

HISTORY

gnutls-cli is part of GnuTLS, developed by Nikos Mavrogiannopoulos and others starting in 2000. GnuTLS provides an alternative to OpenSSL under the LGPL license, and gnutls-cli serves as its diagnostic and testing tool.

SEE ALSO

openssl(1), curl(1), certtool(1), nmap(1)

Copied to clipboard