How to check an SSL certificate: browser, command line and online
To check an SSL certificate is to confirm that the certificate a site serves is valid for its name, is within its dates, and chains to a trusted root. A browser shows this in a few clicks, OpenSSL and curl show exactly what the server sends, and an online test also reviews the server's TLS settings. This page covers all three, what to look for, and how to tell whether the server sends the file you installed. What a certificate holds in the first place is explained in what an SSL certificate is, the overview of this section. Each test an SSL checker runs, with the OpenSSL command for it, is listed in what an SSL checker tests.
- Confirm
- the names, the dates, the chain and the issuer
- In Chrome
- the icon to the left of the address, then Connection is secure, then Certificate is valid [1][2]
- In Firefox
- the padlock, then Connection secure, More information and View Certificate [3]
What to check
Whatever tool you use, four things decide whether visitors connect without a warning:
Dates. The current time is between the certificate's start and end dates, notBefore and notAfter in RFC 5280 [7]. A certificate close to its end date needs renewal now.
Names. Each hostname visitors use, the bare domain and
wwwincluded, is listed in the certificate's Subject Alternative Names.Chain. The server sends its own certificate and the intermediates, and the chain ends at a root the client trusts. How the pieces fit together is explained under certificate chains.
Issuer. The certificate comes from the SSL certificate authority you expect. A different issuer means the certificate in front of visitors is not the one you requested, and the fingerprint check below shows which one it is.
The protocol versions a server accepts matter too, but they are a setting of the server, not of the certificate, and belong to the TLS section of this site.
What a client verifies when it validates a certificate
To validate a certificate is to validate a path: the client takes the certificate the server sent, follows the chain up and ends at a trust anchor, a CA it already trusts. RFC 5280 §6.1 states what the path must satisfy. Its goal is to verify the binding between a name and a public key in the target certificate, starting from the public key of that trust anchor [17]. The conditions:
Going from the trust anchor down to the server's certificate, the subject of each certificate is the issuer of the next, and the first one is issued by the trust anchor [17].
Every certificate on the path was valid at the time in question. That is the dates check from the list above [17].
Each signature verifies with the public key of the certificate above it, and each CA certificate carries basic constraints with cA set to TRUE [17].
No certificate on the path is revoked at that time. A CRL, status information or an out-of-band mechanism can establish that [17].
How the certificates on the path are sent and ordered is covered in the certificate chain guide.
Check a certificate in the browser
A browser shows the certificate of the connection it made, with no terminal. The steps for desktop Chrome and Firefox below follow the browsers' own source code; for Safari, Apple's guide.
In Chrome
Select the icon to the left of the web address [2].
In the panel that opens, select Connection is secure. Chrome shows this entry when it treats the connection as secure [1].
Select Certificate is valid. The certificate viewer opens; hovering over the entry shows which authority issued the certificate [1].
The label depends on the certificate. When the connection is not marked secure, the panel shows the certificate entry at once, and for a certificate with an error it reads Certificate details [1]. In the viewer, the General tab shows who the certificate was issued to and by, the validity period and the SHA-256 fingerprint. The names visitors use are not on that tab: the Details tab lists the certificate hierarchy and the fields, extensions included, and the names sit in the Subject Alternative Name extension [8].
In Firefox
Select the padlock in the address bar. For a secure connection the panel reads Connection secure [3].
Select Connection secure, then More information. The Page Info window opens on its Security tab [3].
Select View Certificate. The viewer opens in a browser tab, with a tab for each certificate in the chain, named after that certificate [3].
Firefox's certificate viewer groups the dates as Not Before and Not After under Validity, gives the issuer under Issuer Name, lists the names under Subject Alt Names, and shows the SHA-256 fingerprint under Fingerprints [3].
Safari on a Mac
Apple's Safari guide for Mac gives two places to look. Safari > Connection Security Details shows whether a website is encrypted, and when a certificate warning appears, Show Certificate opens the certificate for review [9].
The chain a browser shows
The chain in a browser's viewer is the one the browser built, and it can differ from what the server sent. Chromium keeps both: the chain as built by the client during validation, and the certificate as received; the page panel shows the first [8]. Firefox shows the verified path from the site's certificate to the trust anchor when verification succeeded, and the certificates the server provided only when it failed [3]. Both browsers also have their own ways to find an intermediate the server left out: Chromium's network code can retrieve issuers from the AuthorityInfoAccess addresses in a certificate, and Firefox for desktop preloads trusted intermediate certificates into a local cache [8][10]. A chain that looks complete in the viewer can therefore still fail in a client that does neither; our test server without its intermediate stopped curl, as the next section shows [6]. Confirm the chain from the command line or with an online test.
Check from the command line
OpenSSL
From any machine with OpenSSL, against the hostname visitors use:
$ openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -dates -ext subjectAltName
subject=CN = example.com
issuer=CN = Example Lab Intermediate
notBefore=Oct 16 07:08:07 2026 GMT
notAfter=Oct 26 07:08:07 2026 GMT
X509v3 Subject Alternative Name:
DNS:example.com, DNS:www.example.comThat prints the names, the issuer and the dates of the certificate the server actually sends [4]. The output above is from our runs against a local test server, with certificates from our own lab root and -CAfile pointing at that root [6]; a real site prints its own values. s_client also ends its own output with a verify return code, and 0 (ok) means the chain reached a trusted root [4][6]. The other codes, -showcerts and the expiry options are explained with the OpenSSL commands to test a certificate.
curl
curl -v adds lines that start with *, curl's own information about the transfer, and they include the certificate it received [5]. The certificate lines from our runs:
$ curl -v -o /dev/null https://example.com/
* Server certificate:
* subject: CN=example.com
* start date: Oct 16 07:08:07 2026 GMT
* expire date: Oct 26 07:08:07 2026 GMT
* subjectAltName: host "example.com" matched cert's "example.com"
* issuer: CN=Example Lab Intermediate
* SSL certificate verify ok.The subjectAltName line is curl's name check. For a name the certificate does not list, curl stops with exit code 60, which its manual defines as a peer certificate that cannot be authenticated [5][6]:
curl: (60) SSL: no alternative certificate subject name matches target host name 'shop.example.org'When our test server sent its certificate without the intermediate, curl stopped with SSL certificate problem: unable to get local issuer certificate, again with exit code 60 [6]. The causes and fixes are on unable to get local issuer certificate.
Is the server sending the file you installed?
Two certificates with the same fingerprint can be considered the same certificate [4]. Compare the fingerprint of the file with that of the certificate the server sends (the values are shortened here):
$ openssl x509 -in cert.pem -noout -fingerprint -sha256
sha256 Fingerprint=89:55:F5:FC:…:8B:A6:FD:8C
$ openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -fingerprint -sha256
sha256 Fingerprint=89:55:F5:FC:…:8B:A6:FD:8CKeep -sha256. Without it, -fingerprint uses SHA-1 [4], and a SHA-1 value cannot be compared with the SHA-256 fingerprint in the certificate viewer of Chrome or Firefox [8][3]. To compare with a browser, read the hex digits and ignore separators and letter case.
In our runs, the renewed certificate was copied over the file while the test server kept running. The file then showed the new fingerprint, serial number and end date. The connection kept showing the old ones until the server was restarted [6]. So after replacing the files, make the server load them again (in our runs, a restart did) and compare again. If the two still differ, the connection may not reach that server at all: something in front of it, such as a load balancer or a CDN, can present its own certificate.
Find the certificate on your server
Sometimes the question is not whether the certificate is valid, but which file the server uses. Its configuration says:
nginx.
ssl_certificatein the site'sserverblock names a PEM file; the intermediate certificates of the chain go in the same file, after the site's certificate [11]. See installing on nginx.Apache.
SSLCertificateFilein the virtual host points to a PEM file that holds at least the site's own certificate [12]. See installing on Apache.IIS. The https binding refers to a certificate in a Windows certificate store: HTTP.sys keeps its hash and the store name for the IP address and port, and
netsh http show sslcertprints them [13]. See installing on IIS.Certbot.
certbot certificateslists the certificates Certbot knows about, with their domains, expiry dates and paths; the files live in/etc/letsencrypt/live/under the certificate name [14].
Then compare that file with what the server sends: run openssl x509 -noout -fingerprint -sha256 on the file and on the connection, as above.
Check with an online test
An online test connects from outside your network, so it sees what visitors see. The Qualys SSL Labs Server Test is a free online service that runs an analysis of the configuration of a web server on the public Internet and grades the result [15]. The form has an option, Do not show the results on the boards, and the same page lists recently tested hostnames [15].
Use an online test after the first installation and after configuration changes. A host that is not on the public Internet needs the command line, which also suits a quick check after each renewal.
Check expiry on a schedule
A one-off check finds today's problem. An end date is a problem with a date attached, and under the CA/Browser Forum Baseline Requirements a publicly trusted certificate issued from 15 March 2026 lasts at most 200 days [16], so the check belongs on a schedule. openssl x509 -checkend takes a number of seconds and exits with a nonzero status if the certificate expires within them [4], which a script or a monitor can act on. Run it from outside the server and apart from whatever renews the certificate, so that a failed renewal shows up before visitors see it.
FAQ
What is a website's security certificate?
It is the X.509 certificate that a site's server presents when a browser connects over TLS. A certificate binds a public key to a subject, and a trusted CA asserts that binding by digitally signing the certificate. The server conveys its certificate chain to the browser during the TLS handshake. A browser can show the certificate of the connection it made, and the steps for each browser are in the section Check a certificate in the browser above.
How do I check if an SSL certificate is valid?
In Chrome, select the icon next to the address, then Connection is secure, then Certificate is valid to open the certificate. From a terminal, run openssl s_client -connect example.com:443 -servername example.com and look for Verify return code: 0 (ok). Either way, confirm the dates, the names and the issuer. [1][4]
How do I view an SSL certificate in Chrome?
How do I find which SSL certificate my server uses?
Why does the certificate look fine in my browser but fail elsewhere?
Sources
Chromium source, Page Info: page_info_strings.grdp, page_info_main_view.cc, page_info_security_content_view.cc.
Google Chrome Help: Check if a site's connection is secure.
Firefox 147 source: browser.ftl, identityPanel.inc.xhtml, pageInfo.ftl, pageinfo/security.js, certviewer.ftl, certviewer.mjs, nsITransportSecurityInfo.idl.
OpenSSL 3.0 manual pages: openssl-s_client, openssl-x509 and X509_STORE_CTX_get_error.
curl man page: --verbose and exit code 60.
Our runs: OpenSSL 3.0.13 and curl 8.5.0 on Linux against a local
openssl s_server, with test certificates for example.com from our own lab root.RFC 5280, Internet X.509 Public Key Infrastructure Certificate and CRL Profile, §4.1.2.5.
Chromium source, certificate viewer and connection state: certificate_viewer.html, certificate_viewer_webui.cc, x509_certificate_model.cc, ssl_info.h, content_utils.cc, cert_issuer_source_aia.h.
Apple, Safari User Guide for Mac: Avoid fraud by using encrypted websites.
Mozilla Security Blog: Preloading Intermediate CA Certificates into Firefox.
nginx, Module ngx_http_ssl_module: ssl_certificate.
Apache HTTP Server 2.4, mod_ssl: SSLCertificateFile.
Microsoft Learn, IIS: How to Set Up SSL on IIS 7 or later.
Certbot User Guide: Managing certificates; Where are my certificates?
CA/Browser Forum Baseline Requirements v2.3.1, §6.3.2.
RFC 5280, Internet X.509 Public Key Infrastructure Certificate and CRL Profile: §6.1 Basic Path Validation, §6.1.3 Basic Certificate Processing, §6.1.4 Preparation for Certificate i+1.
RFC 5280, Internet X.509 Public Key Infrastructure Certificate and CRL Profile: §3.1 X.509 Version 3 Certificate.
RFC 9846, The Transport Layer Security (TLS) Protocol Version 1.3: §4.5.1 Certificate.