ERROR:ssl_client_socket_openssl.cc(1158)] handshake failed with ChromeDriver Chrome browser and Selenium

You get this error when the browser asks you to accept the certificate from a website. You can set to ignore these errors by default in order avoid these errors.

For Chrome, you need to add –ignore-certificate-errors and
–ignore-ssl-errors ChromeOptions() argument:

options = webdriver.ChromeOptions()
options.add_argument('--ignore-certificate-errors')
options.add_argument('--ignore-ssl-errors')
driver = webdriver.Chrome(chrome_options=options)

For the Firefox, you need to set accept_untrusted_certs FirefoxProfile() option to True:

profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = True
driver = webdriver.Firefox(firefox_profile=profile)

For the Internet Explorer, you need to set acceptSslCerts desired capability:

capabilities = webdriver.DesiredCapabilities().INTERNETEXPLORER
capabilities['acceptSslCerts'] = True
driver = webdriver.Ie(capabilities=capabilities)

Leave a Comment