1

I am trying to automate a https contained url by using Selenium, WebdriverIO and JavaScript, but it started redirecting to Your connection is not secure page. enter image description here I have tried to set 'security.insecure_field_warning.contextual.enabled': false and some other preferences as well in firefoxProfile, but it also didn't help.

firefoxProfile used:

firefoxProfile: {
    'media.navigator.permission.disabled': true,
    'media.peerconnection.video.h264_enabled': true,
    'media.navigator.streams.fake': true,
    'dom.webnotifications.enabled': false,
    'media.getusermedia.screensharing.enabled': true,
     setAcceptUntrustedCertificates: true,
     setAssumeUntrustedCertificateIssuer: true,
    'security.insecure_field_warning.contextual.enabled': false 
  },

Selenium and Firefox versions:

  • "selenium-standalone": "~5.8.0"
  • Firefox version : 60.0 (64-bit)
piet.t
  • 11,718
  • 21
  • 43
  • 52
Pradeep
  • 12,309
  • 3
  • 20
  • 25

1 Answers1

0

To get rid of Your connection is not secure page you have to set the following flags and add a preference through the firefox profile :

  • setAcceptUntrustedCertificates() flag to true
  • setAssumeUntrustedCertificateIssuer() flag to true
  • "security.insecure_field_warning.contextual.enabled" preference to false

The firefoxProfile settings will be :

firefoxProfile: {
    'setAcceptUntrustedCertificates': true,
    'setAssumeUntrustedCertificateIssuer': true,
  },

Additionally you will also have to set the Preference security.insecure_field_warning.contextual.enabled to false

You can find a detailed discussion in Firefox selenium webdriver gives “Insecure Connection”

Note : Ensure that you are using compatible Selenium Client, GeckoDriver and Firefox Browser combination.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • I tried by setting following preferences, but still getting same error - `setAcceptUntrustedCertificates: true, setAssumeUntrustedCertificateIssuer: true, 'security.insecure_field_warning.contextual.enabled': false` – Pradeep May 15 '18 at 11:53
  • Did you bump up the _Selenium Client, GeckoDriver and Firefox Browser_ versions to the latest releases? Can you update the question with your current configuration? – undetected Selenium May 15 '18 at 11:57
  • Shouldn't `setAcceptUntrustedCertificates` and `setAssumeUntrustedCertificateIssuer` be within single quotes i.e. within `'.....'`? Where thse two attributes were to be **set** directly, `security.insecure_field_warning.contextual.enabled` is a _Preference_ to be set and I guess must be handled differently? Am I right? – undetected Selenium May 15 '18 at 12:08
  • i tried to set `setAcceptUntrustedCertificates` and `setAssumeUntrustedCertificateIssuer` within single quotes, but `VSCode` complaint about the error and removed it after formatting. :( – Pradeep May 15 '18 at 12:11
  • I am afraid :( not accustomed with `webdriver-io` or `VSCode` but implementing the configurations I have provided will definitely solve your issue, did you have a look at the _Java_ discussion I have provided for your reference? – undetected Selenium May 15 '18 at 12:15
  • Thanks.. no issue, yes i have gone through your provided link, but unfortunately we can't use same solution here. – Pradeep May 15 '18 at 12:19