How to ignore ssl_client_socket_impl.cc(1061)] handshake failed in selenium c# ChromeDriver
You can restrict Chromium's log level to 3, so that only fatal errors are logged. Please bear in mind that you won't see any other error-related messages which might cause mayhem in production! The code looks like this:
var chromeOptions = new ChromeOptions();
chromeOptions.AddArgument("log-level=3");
var driver = new ChromeDriver(options : chromeOptions);
handshake failed; returned -1, SSL error code 1, net_error -201
its look like your browser store don't have certificate required by website. Please use chrome options as below:
options = webdriver.ChromeOptions()
options.add_argument("--ignore-certificate-error")
options.add_argument("--ignore-ssl-errors")
browser = webdriver.Chrome('C:\\webdrivers\\chromedriver.exe',options=options)
browser.get("https://www.worldometers.info/coronavirus/")
With Capabilites:
caps = webdriver.DesiredCapabilities.CHROME.copy()
caps['acceptInsecureCerts'] = True
caps['acceptSslCerts'] = True
driver = webdriver.Chrome(desired_capabilities=caps)
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)
Related Topics
Datagridview: How to Set a Cell in Editing Mode
What Is a Regular Expression for Parsing Out Individual Sentences
Task<> Does Not Contain a Definition for 'Getawaiter'
How to Take the Cartesian Join of Two Lists in C#
Reference Types Live on the Heap, Value Types Live on the Stack
Incorrectly Aligned or Overlapped by a Non-Object Field Error
Sending an Array of Values to Oracle Procedure to Use in Where in Clause
C# VS C - Big Performance Difference
Why Does .Net Foreach Loop Throw Nullrefexception When Collection Is Null
How to Force My C# Winforms Program Run as Administrator on Any Computer
How to Bring Up the Built-In File Copy Dialog
How to Hide an Inherited Property in a Class Without Modifying the Inherited Class (Base Class)
What Could Be Causing a System.Typeloadexception
Does C# Support Project-Wide Default Namespace Imports Like Vb.Net
Get Values from Process Standardoutput
If Strings Are Immutable in .Net, Then Why Does Substring Take O(N) Time