Skip to content

feat: add ignore_https_errors input for scanning self-signed SSL environments - #224

Open
mvanhorn wants to merge 4 commits into
github:mainfrom
mvanhorn:fix/150-ignore-https-errors-self-signed-ssl
Open

mvanhorn wants to merge 4 commits into
github:mainfrom
mvanhorn:fix/150-ignore-https-errors-self-signed-ssl

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an ignore_https_errors input so the scanner can run against environments with self-signed or otherwise invalid certificates, e.g. internal staging hosts (#150). Off by default; nothing changes unless explicitly opted in.

Changes

  • action.yml: new optional ignore_https_errors input (default false), documented in the README.
  • index.ts: reads the input (loadIgnoreHttpsErrors) and threads it through to the scan.
  • findForUrl.ts: when enabled, sets Playwright's ignoreHTTPSErrors: true on the browser context; when disabled the context options are untouched.

Note: this touches the same file as #223 (the SPA networkidle wait), so whichever lands second may need a trivial rebase; the changes are logically independent.

Testing

vitest run tests/findForUrl.test.ts — 8 passed, including new cases asserting the context gets ignoreHTTPSErrors only when the input is enabled.

Closes #150

AI was used for assistance.

Opt-in input that sets Playwright's ignoreHTTPSErrors on the browser
context so the scanner can run against staging hosts with self-signed or
invalid certs. Default off; behavior unchanged unless enabled.

Closes github#150

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…s-errors-self-signed-ssl

# Conflicts:
#	.github/actions/find/action.yml
#	.github/actions/find/tests/findForUrl.test.ts
#	README.md
@mvanhorn

Copy link
Copy Markdown
Contributor Author

Main's newer inputs collided with this one, so a436263 merges main and keeps both: ignore_https_errors now sits next to group_by, dry_run and the file filters in the README table and the find action.yml. The ignoreHTTPSErrors tests switched to main's shared browserNewContext mock. findForUrl tests pass (25/25), and eslint, prettier and tsc are clean.

helen
helen previously approved these changes Oct 29, 2026

@helen helen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me at a glance, letting tests run and getting a second gut check and then will see if I can go ahead and roll this into the release I am preparing to cut

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The HTTPS-error opt-in is missing from authentication, blocking built-in login on self-signed hosts, and the added sixth argument breaks an existing test assertion.

2 open issues
What changed in this PR

Adds an opt-in ignore_https_errors setting for scanning environments with self-signed or invalid certificates, addressing #150. Certificate validation remains enabled by default.

Changes:

  • Declares the input and forwards it to the Find action.
  • Enables Playwright’s ignoreHTTPSErrors context option only when requested.
  • Documents the setting and adds tests for enabled, omitted, and disabled values.
File Description
README.md Documents the input in the workflow example and inputs table.
action.yml Declares the input and forwards it to Find.
.github/​actions/​find/​tests/​findForUrl.test.ts Tests browser-context options for all three input states.
.github/​actions/​find/​src/​index.ts Parses the input and passes it to URL scans.
.github/​actions/​find/​src/​findForUrl.ts Conditionally enables Playwright’s HTTPS-error bypass.
.github/​actions/​find/​README.md Documents the Find action’s new input.
.github/​actions/​find/​action.yml Declares the optional input with a default of false.

Review effort: Max (auto)

includeScreenshots,
reducedMotion,
colorScheme,
ignoreHttpsErrors,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in d3018b0. The passes waitForSelectors through to the URL scan assertion now expects the trailing false for the new argument. The index and findForUrl tests pass locally (27/27).

Comment thread action.yml
include_screenshots: ${{ inputs.include_screenshots }}
reduced_motion: ${{ inputs.reduced_motion }}
color_scheme: ${{ inputs.color_scheme }}
ignore_https_errors: ${{ inputs.ignore_https_errors }}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. d3018b0 adds an ignore_https_errors input to the auth action, applies ignoreHTTPSErrors to its browser context when it is true, and the root action.yml now passes the input to Authenticate as well as Find. The auth README documents it. tsc, eslint and prettier are clean on the auth action.

@helen

helen commented Oct 29, 2026

Copy link
Copy Markdown
Member

@mvanhorn I triggered a Copilot review since I know I was only looking at the diff, comments seem legit so I'll leave it to you to address whenever you want to revisit. @abdulahmad307 mirrored into #293 so that the tests can successfully run, hopefully this time we can merge this one once ready though.

The built-in login flow ran in a browser context without
ignoreHTTPSErrors, so login failed on self-signed hosts before Find
could run. Auth now takes the same input and the root action passes it
through. The find index test expects the new sixth argument.
@mvanhorn

Copy link
Copy Markdown
Contributor Author

Pushed d3018b0 for the two review comments. The fork run of Test (sites/site-with-errors) stops at checkout with "Input required and not supplied: token", since secrets are not available to fork PRs. The failure that showed up on the mirror in #293 was the waitForSelectors index assertion, which this commit fixes; the index and findForUrl tests pass locally (27/27).

@abdulahmad307

Copy link
Copy Markdown
Contributor

one final request; copilot is suggesting to add this warning to the readme: #294 (comment). If we can get that in, I think we'll be good to merge this PR in (I will close the duplicate PR that I opened - we just used that to run test workflows)

Added a warning about disabling TLS certificate validation when ignoring HTTPS errors in the README.
@abdulahmad307

Copy link
Copy Markdown
Contributor

actually, I added the warning myself in this commit: https://github.com/github/accessibility-scanner/pull/224/commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot scan sites with self-signed SSL certs

4 participants