Skip to content

devtools: Honor acceptInsecureCerts and ignoreHTTPSErrors settings#10329

Merged
christian-bromann merged 4 commits intowebdriverio:mainfrom
nextlevelbeard:devtools/insecure-certs
May 8, 2023
Merged

devtools: Honor acceptInsecureCerts and ignoreHTTPSErrors settings#10329
christian-bromann merged 4 commits intowebdriverio:mainfrom
nextlevelbeard:devtools/insecure-certs

Conversation

@nextlevelbeard
Copy link
Member

@nextlevelbeard nextlevelbeard commented May 6, 2023

Proposed changes

Testing against local web development servers often require automation to ignore self-signed certificates. There is a W3C spec capability (acceptInsecureCerts) that allows us to proceed in these cases. However the automation protocol devtools was not respecting this capability and passing the need flags to the browser launcher routines.

We already have the devtools option ignoreHTTPSErrors that can be defined in the wdio:devtoolsOptions capability. This seems to only have effect for Firefox.

For Webkit/Blink based browsers, it is necessary to pass the (chrome)flag --ignore-certificate-errors.

There is some code duplication due to separated logic of launching Chrome and Edge.

fixes #10328

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Further comments

Reviewers: @webdriverio/project-committers

@nextlevelbeard
Copy link
Member Author

@christian-bromann Maybe we should cleanup this logic or at least align implementation.

ignoreHTTPSErrors is supposed to ignore more than just bad certificates, I suppose, but it's only really meant to be used with Firefox in Puppeteer, AFAIK.

For this use case we are going to have two settings that achieve the same thing: ignoreHTTPSErrors and W3C spec acceptInsecureCerts.

Can you think of more flags to pass to Webkit/Blink engines when we ignoreHTTPSErrors, other than just --ignore-certificate-errors?

@nextlevelbeard nextlevelbeard requested review from christian-bromann, mathew-jithin and mgrybyk and removed request for christian-bromann and mgrybyk May 6, 2023 15:16
Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

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

Can you think of more flags to pass to Webkit/Blink engines when we ignoreHTTPSErrors, other than just --ignore-certificate-errors?

Not really. I am not too familiar with all flags.

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@christian-bromann christian-bromann merged commit 6760e7b into webdriverio:main May 8, 2023
@nextlevelbeard
Copy link
Member Author

@christian-bromann how come this was left out of the changelog?

@christian-bromann
Copy link
Member

christian-bromann commented May 9, 2023

I missed to label this PR correctly, sorry about that, let me add it manually.

@nextlevelbeard
Copy link
Member Author

I missed to label this PR correctly, sorry about that, let me add it manually.

@christian-bromann I see you added it thank you, but there's extra erroneous information unrelated to the feature, has nothing to do with the browserstack-service


#10329 [browserstack-service] devtools: Honor acceptInsecureCerts and ignoreHTTPSErrors settings (@ nextlevelbeard)


@christian-bromann
Copy link
Member

christian-bromann commented May 10, 2023

Ah sorry, copy&paste mistake , let me update

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.

[🐛 Bug]: acceptInsecureCerts capability not being respected with devtools automationProtocol

2 participants