Skip to main content
HandyWeb

TLS Certificate Check with nw

Build the nw command that checks the TLS connection and the certificate of a site. Learn what expired, untrusted, and name mismatch errors mean.

TLS handshake test (test tls)

Opens a secure TLS connection and checks the certificate. The default port is 443.

How to read the result

  • tls.cert_expired: the certificate has expired. tls.cert_untrusted: no trusted authority signed it. tls.hostname_mismatch: the certificate is for another name.
  • tls.handshake_failure and tls.reset: the secure connection failed or was cut.

Exit codes

0: worked. 1: failed. 2: wrong command.

Install nw

If you have Go, this one command is enough. It puts the file in $(go env GOPATH)/bin, usually ~/go/bin.

go install github.com/radestsam/nwrk/cmd/nw@latest

Other ways to install are on the nwrk.ir install page: ready-made builds for Linux, macOS, and Windows, and install scripts.

The install scripts download a script and run it. Read the script before you run it.

nwrk.ir install page (opens in a new tab)

This page only builds the command. You run nw yourself, on your own device.

How to Use It

  1. Type the domain. Add the port if it is not 443.
  2. Copy the command. Run it in your terminal.
  3. Look up the error code in the section below.

Questions and Answers

What if I already have the certificate?

The SSL Certificate and CSR Decoder on this site reads a certificate you paste. nw gets the certificate from the server.

How do I check the whole connection?

Use nw diagnose. It tests DNS, TCP, TLS, and HTTP one after another.

Good to Know

This page only builds the command. It runs no test. To run it, install nw on your own device. The commands come from the nwrk.ir docs for version 0.5.

Source code of this tool (opens in a new tab)Report a problem on GitHub (opens in a new tab)