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.
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
- Type the domain. Add the port if it is not 443.
- Copy the command. Run it in your terminal.
- 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.
Related Tools
- SSL Certificate and CSR DecoderRead an SSL/TLS certificate (X.509) or a certificate request (CSR) in PEM form: subject, issuer, validity, domain names, key, and SHA-256 fingerprint.
- Diagnose Why a Website Won't Load with nwBuild the nw diagnose command. It tests DNS, TCP, TLS, and HTTP one by one and shows the first step that fails, so you know where the problem is.
- nw Command BuilderBuild the exact nw command to test DNS, TCP, TLS, or HTTP, trace a path, or find why a connection fails. Learn how to read the result and the exit code.
Source code of this tool (opens in a new tab)Report a problem on GitHub (opens in a new tab)