4

While running my python selenium script for firefox browser; I encountered an issue saying

Your connection is not secure

It is not allowing me to Add exception and blocked

Confirm Security Exception

as well (even with preferences manually). hence i am trying to add profiles like "webdriver_accept_untrusted_certs", "webdriver_accept_untrusted_certs" but nothing is helping me out. Not sure how to tackle this...

I need some help here

Currently using the following... Python 3.4.4 selenium==3.4.1 linux 32 bit Firefox 60.6.1esr (32-bit) Everything seems to be compatible, so no issue here.

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import     DesiredCapabilities

cap = DesiredCapabilities().FIREFOX
profile = webdriver.FirefoxProfile()
profile.set_preference("webdriver_assume_untrusted_issuer", False)
profile.update_preferences()
browser = webdriver.Firefox(capabilities=cap,firefox_profile=profile)
browser.get('my url')

and

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import     DesiredCapabilities

cap = DesiredCapabilities().FIREFOX
profile = webdriver.FirefoxProfile()
profile.set_preference("webdriver_accept_untrusted_certs", True)
browser = webdriver.Firefox(capabilities=cap,firefox_profile=profile)
browser.get('my url')

I want to get rid of the "Your Connection is not secure"

3

1 Answer 1

4

For FireFox you can use:

from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

desired_caps = DesiredCapabilities.FIREFOX.copy()
desired_caps.update({'acceptInsecureCerts': True, 'acceptSslCerts': True})
driver = webdriver.Firefox(capabilities=self.desired_caps)

For Chrome:

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument('--ignore-ssl-errors=yes')
options.add_argument('--ignore-certificate-errors')
driver = webdriver.Chrome(options=options)
3
  • 1
    no working with ChromeDriverManager().install()
    – myworldbox
    Commented May 9, 2021 at 9:38
  • @myworldbox in order for us to help you please provide more details. How did you start your chrome instance? Commented May 9, 2021 at 20:43
  • The real solution should be don’t register a email with a common phone number and enable less security app to be executed.
    – myworldbox
    Commented May 11, 2021 at 0:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.