[Go to site: main page, start]

squirrelscan
GitHub

HTTP to HTTPS redirect: how squirrel probes for it

squirrel requests the http:// version of a sample of your URLs and reports the ones that answer over plain HTTP without redirecting to HTTPS.

What an HTTP to HTTPS redirect is

An HTTP to HTTPS redirect is a response on port 80 that sends the client to the https:// form of the same URL. It exists because links, bookmarks and typed addresses still arrive over plain HTTP, and without a redirect they either fail or serve a duplicate copy of the site on an insecure origin.

Search engines treat http://example.com/page and https://example.com/page as separate URLs. A permanent redirect consolidates them and keeps the HTTPS version as the indexed one. HSTS eventually removes the need for the redirect in browsers that have already seen the header, but the redirect is what handles the first visit and every non-browser client.

What squirrel checks

The rule is site-wide and makes live network requests. It builds a sample of same-hostname URLs starting with the base URL, adds crawled pages whose status code is under 400 until the sample limit is reached, rewrites each to http:// and follows the redirect chain. It emits a single check named http-to-https:

  • Skipped when there is no base URL. Message: No base URL available.
  • Skipped when the base URL does not parse. Message: Invalid base URL.
  • Skipped when the base URL is not HTTPS. Message: Base URL is not HTTPS.
  • Fail when at least one probed URL answers over plain HTTP and never reaches HTTPS. Message: 3 HTTP URL(s) do not redirect to HTTPS (20 of 20 URL(s) probed), with each entry labelled http://example.com/page answered 200 over HTTP without redirecting to HTTPS.
  • Pass when every probed URL redirects to HTTPS. Message: 20 sampled HTTP URL(s) redirect to HTTPS.
  • Info when nothing could be verified (no listener on port 80, errors, rate limiting) or the run was partial and found no failure. A URL that cannot be reached over HTTP at all gets no verdict and is not a finding.

Probes run five at a time with a 100 ms stagger, each hop times out after 10 seconds and chains stop at 10 hops. Each probe is one HEAD request without retries, sent with the same user agent and headers as the crawl. A total budget (default 20 seconds, probeBudgetMs) stops workers picking up new URLs; probes already in flight are still awaited. When the budget runs out the check says so: the message reads partial coverage with the number of URLs not probed, and details.partial is true, so a slow host is never reported as clean. Raise probeBudgetMs or lower sampleLimit to cover the whole sample. Redirect loops get no verdict. A redirect to a scheme other than http or https, to a link-local or cloud metadata address such as 169.254.169.254, or to another host whose DNS answers include one (or whose lookup fails) is not followed: the chain stops at that redirect. With --offline, a redirect to another host is not followed either. On the CLI, with the site’s own hostnames checked (see follow_redirects), every probe and hop connects to the address its name was checked on, and a host that resolves to a link-local or cloud metadata address gets no request: that URL gets no verdict.

squirrel analyze re-runs rules over the stored crawl and makes no live request, so there this rule is a skipped check with skipReason analyze-offline, the value not-checked and the message analyze runs offline; run squirrel audit to probe. It is listed under notChecked with outcome coverage_gap, so a finding of it stays open. Run squirrel audit to probe.

On a local or private-network host, such as localhost or 192.168.1.10, the rule is skipped and left out of the score, because a dev server is not the production edge. See Transport and delivery rules do not apply.

How to fix it

server {
  listen 80;
  server_name example.com www.example.com;
  return 301 https://example.com$request_uri;
}

Redirect in one hop, preserving the path and query string, and use 301 rather than 302 so the target is the canonical URL. Chaining HTTP to HTTPS to a canonical host costs a round trip on every first visit.

Rule IDsecurity/http-to-https
CategorySecurity
ScopeSite-wide
Severitywarning
Weight3/10

Options

OptionTypeDefaultDescription
sampleLimitinteger, 1 to 10020Maximum number of pages to probe for HTTP to HTTPS redirects
probeBudgetMsinteger, 1000 to 60000020000Total time budget for all probes, in milliseconds. When it runs out the rule reports partial coverage

Configuration example

[rule_options."security/http-to-https"]
sampleLimit = 40
probeBudgetMs = 60000

Enable / disable

Disable this rule

[rules]
disable = ["security/http-to-https"]

Disable all Security rules

[rules]
disable = ["security/*"]

Enable only this rule

[rules]
enable = ["security/http-to-https"]

enable replaces the default ["*"], so this is the only rule selected. Leave disable out: a rule that matches any disable pattern is skipped even when enable names it. Only an enabled setting under a rule’s own [rule_options] table overrides both lists.

Check names by outcome

Each check name this rule can emit, by what it means to a tool comparing two audits. A problem check is a finding. A clean check says the rule ran over what it covers and found nothing; it clears the problem checks listed beside it, so a finding is fixed when the rule ran over the same scope and a clean check took its place. A not checked check says the rule did not evaluate, and never clears a finding.

Check nameOutcomeClears
http-to-httpsProblem
http-to-httpsCleanhttp-to-https
http-to-httpsNot checked

Security findings ship in every audit next to the SEO, performance and agent experience rules. See Website security scan with AI for how an agent works through a report.

Glossary: HTTPS.

References

Check your site

Run squirrel audit https://nutshop.squirrelscan.com and open the Security section of the report. Each HTTP URL that does not redirect is listed with its status code. Signed-out local audits need no account and cost nothing. Signed-in audits spend credits.

Type to search…

↑↓ navigate↵ openesc close