Call response.securityDetails() on the HTTPResponse you get from page.goto() or a page response event. It returns TLS and certificate metadata for a response received over a secure connection, or null when those details are unavailable. Also handle the separate case where page.goto() itself returns null.
Read security details from a navigation response
This complete example checks both nullable results, then prints the six documented fields. It uses Puppeteer 25.12.0 API signatures; compare them with the version installed in your project because the repository’s main branch can change.
As an Amazon Associate I earn from qualifying purchases.
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
const response = await page.goto('https://example.com');
if (response === null) {
console.log('No navigation response object');
} else {
const details = response.securityDetails();
if (details === null) {
console.log('No secure-connection details for this response');
} else {
console.log({
protocol: details.protocol(),
issuer: details.issuer(),
subject: details.subjectName(),
subjectAlternativeNames: details.subjectAlternativeNames(),
validFrom: details.validFrom(),
validTo: details.validTo(),
});
}
}
} finally {
await browser.close();
}
The two null checks mean different things. page.goto() may return null for cases such as about:blank or a same-URL navigation that changes only the hash. If there is an HTTPResponse but its securityDetails() is null, Puppeteer has no secure-connection details to return for that response.
Recommended Free Tools
Inspect responses beyond the main navigation
To observe page traffic such as scripts, images, or API requests, attach a response listener. The listener receives an HTTPResponse for each completed response event:
#1 Best Overall
page.on('response', response => {
const details = response.securityDetails();
console.log(response.url(), details?.protocol() ?? null);
});
Use response.url() to identify the resource and inspect additional fields as needed. A navigation return value is only the response associated with that navigation; it is not a substitute for listening to the other page responses.
Understand the returned fields
| Method | What it returns |
|---|---|
protocol() |
The security protocol in use, for example TLS 1.2. |
issuer() |
The certificate issuer name. |
subjectName() |
The certificate subject name. |
subjectAlternativeNames() |
The certificate’s subject alternative name (SAN) list. |
validFrom() |
Unix timestamp marking the start of the certificate’s validity period. |
validTo() |
Unix timestamp marking the end of the certificate’s validity period. |
Convert the validity timestamps to readable dates when displaying them. For example, in JavaScript, use new Date(details.validFrom() * 1000) and new Date(details.validTo() * 1000); Unix timestamps are in seconds while JavaScript date values use milliseconds.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
The Puppeteer API reference describes SecurityDetails as representing “the security details of a response that was received over a secure connection.” These methods expose documented TLS and certificate metadata; they are not documented as a complete certificate-chain validation report or an overall security verdict for a site.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Keep TLS details separate from other response checks
securityDetails() answers a narrower question than general response inspection. The HTTPResponse API separately exposes status, headers, remote address, request, cache state, and service-worker state. Use each field for its own purpose:
Rank #3
securityDetails()provides the available TLS protocol and certificate metadata.headers()provides response headers, which are the place to inspect response policy headers. Header names in the returned object are lowercase; duplicate values are combined with commas exceptSet-Cookie, whose values are separated by newlines.status()reports the HTTP status code.remoteAddress()reports connection-address information.fromCache()andfromServiceWorker()indicate whether the response came from cache or a service worker.
None of these observations alone should be presented as a comprehensive security audit.
Interpret status codes, redirects, and failed requests
An HTTP error status does not mean the network request failed. A 404 or 503 still completes as an HTTP response, so inspect response.status() to distinguish it from a failed request. Puppeteer’s request lifecycle also distinguishes completion from failure: requests emit request, then requestfinished when the body has downloaded; failed requests instead emit requestfailed.
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
Redirects create another distinction: the redirected request finishes and a new request is issued for the destination URL. If you need details for the final page or for each hop, observe response events and identify responses by URL rather than assuming one navigation response represents every redirect.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Troubleshoot missing security details
page.goto()returned null: There is no navigation response object to inspect. This can happen withabout:blankor a same-URL hash-only navigation. Handle this before calling any response method.securityDetails()returned null: No secure-connection details are available on that response. Check that the response of interest is the one you intended to inspect and handle null rather than calling methods on it.- You see a 404 or 503: The request may have completed normally at the network level with an HTTP error response. Read
status(); do not treat a non-2xx status as equivalent torequestfailed. - You do not see the destination response after a redirect: A redirect issues another request. Listen for page responses and inspect the URL of each response.
- You need security headers, not certificate metadata: Read
response.headers().securityDetails()is not the response-policy-header interface.
Or skip the browser setup
If your task is to capture a page image or PDF rather than inspect Puppeteer’s TLS metadata, ScreenshotNeo is a website screenshot API and MCP server. It is not a replacement for securityDetails(); it provides a simpler capture path when you need an output file:
Best Value
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
See the ScreenshotNeo API documentation for request options. Cookie and consent banners are accepted or removed before capture, along with known newsletter popups and chat widgets; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed. Its MCP server lets AI agents take screenshots, and the free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000. Sign up for the free plan.
Frequently Asked Questions
Does securityDetails() return an object for an HTTP response?
It returns security details when the response was received over a secure connection; otherwise it can return null.
Are validFrom() and validTo() JavaScript millisecond timestamps?
No. They are Unix timestamps in seconds; multiply by 1,000 before passing them to JavaScript’s Date constructor.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Does a Puppeteer 404 mean the request failed?
No. An HTTP 404 is still an HTTP response. Check status() separately from the requestfailed event.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




