Selenium Webdriver SSL Certificate Hostname Mismatch Problem - ssl

I have recently run into problems using the .NET version of Selenium Webdriver to run tests against a website running in a test environment where the SSL certificate does not match the hostname it’s served from.
To make Firefox accept the SSL certificate while it is controlled by Selenium, I have tried using firefoxProfile.SetPreference("browser.ssl_override_behavior", 1) and firefoxProfile.AcceptUntrustedCertificates but have not been successful.
Is there any other way I can resolve this problem?
Thanks in advance to anyone who can help,
Brett

the way we got around this was hacking local hosts file...

Related

Chrome driver unable to detect client certificate in headless mode

Im trying to access a url and run tests which specifically needs client certificate .client certificate is installed in my system and even though if I have multiple certs I’m able to select the one needed for the url and run the tests using selenium automation perfectly in normal mode but when I’m trying to run tests In headless mode it is unable to detect the cert which is installed in my system . Not sure what is the issue but is there any way I could resolve this issue.
I am getting this error “org.openqa.selenium.WebDriverException:unknown error:net :: ERR_SSL_PROTOCOL_ERROR”
Note :
I have tried “AutoselectcertificateforUrls “ As well but it didn’t work I don’t see any configuration settings for chrome
And also I don’t have permissions to download cert in .p12 format

how to bypass certificate error in opera browser with python selenium on browserstack?

When testing on opera browser with python selenium on browserstack I see the following certificate error
How can I bypass this with python selenium? I have tried adding the capability
desired_cap['acceptSslCerts']=True but that doesn't work.
As per the link, https://www.browserstack.com/automate/capabilities, I believe the correct way of setting 'acceptSslCerts' capability is('true' and not 'True'):
'acceptSslCerts' : 'true'
Let me know if that helps.
As Opera 20 and above uses the Windows certificate store, the warning can be bypassed.
If you want to use a unknown selfsigned certificate, you have to add it to Windows Trusted Root Certificates (But be careful using certificates without proofing they are really for the server!).
See: https://www.thewindowsclub.com/manage-trusted-root-certificates-windows

How to handle ssl certificate in selenium IDE

I am new to selenium. I am doing a cross browser testing in a tool called testingbot. When i run my site in their server through selenium ide the test runs till the url is entered in their VM. But after that there is a certificate error and the script is not run after that. The test fails.
Is there any way to handle ssl certificate or bypass it?

Import root CA in chromedriver (Selenium)

I have tried and searched almost everything but still didn't find an answer to import a root CA into chromedriver while running my Selenium test.
Small background info: I am running regression tests with Selenium and chromedriver. My goal is to let these functional tests pass through Zed Attack Proxy. Since the webapplication uses https I need the Zed Attack proxy certificate imported in the chromedriver so it would trust Zed Attack Proxy to decrypt requests passing by.
FYI, this problem cannot be solved by ignoring-certificate-errors because this won't decrypt the requests but simply ignore it.
Any help is appreciated!
The only documentation I know of is https://github.com/SeleniumHQ/selenium/wiki/Untrusted-SSL-Certificates but that only covers firefox :/
I believe you can specify existing Firefox profiles with Selenium, so maybe you can do the same with Chromium ones? If so can you import the cert into a new profile 'manually' and then use that for your testing?
Update, I've also found this: https://unix.stackexchange.com/questions/122753/chrome-certificate :)

Selenium RC and Internet Explorer 7 with rspec for HTTPS and HTTP connections

We test our rails web application with rspec and use the selenium-client (gem version 1.2.18) API in our rspec tests to let selenium RC server (version 2.21.0) steer internet explorer 7 under AP to test our application.
This worked very well until we introduced HTTPS for our login and registration process. Now the user is redirected to the secure version of the login and registration form and afterwards redirected back to the unsecure HTTP site.
For our selenium tests to work with HTTPS and internet explorer 7 we are setting up the selenium driver with "*iexploreproxy" instead of "*iexplore" and use port 4444. We also installed the CyberVillans SSL Certificate as describe here http://blog.mogotest.com/2010/04/13/how-to-accept-self-signed-ssl-certificates-in-selenium/. We run selenium rc server with -trustALLSSLCertificates. This solved the self signed SSL Certificate issues (be aware that selenium RC > 2.21 does not work because of a bug which sets a wrong valid from date).
After that we received "Permission Denied" errors, when running our tests. We found out that this is because of the same origin problem described at http://wiki.openqa.org/display/SEL/Selenium+Core+FAQ under "Why do I get a Permission Denied error when accessing my website via HTTPS?". This problem can be solved by adjusting internet explorers 7 proxy settings and using localhost:4444 to route everything through the selenium RC server. It works, but the problem is that after every test run the proxy settings are reset.
My first question is: How is it possible to make those settings persistent in the internet explorer 7? I read about custom profiles for IE but I haven't found out how to set this up for rspec tests. I also read about a proxy.pac file, but googling for solution without success.
The next problem is that when running our tests we also run into "Access denied" errors by selenium. I have no idea how to solve these and why they occur. So my second question is: How do I get rid of those under the setup described.