8

I am literally stuck to this problem for two days now.

Scenario

The website that needs to be tested has a self-signed certificate. So Internet Explorer (8 in Windows XP) shows

"The security certificate presented by this website was not issued by a trusted certificate authority. The security certificate presented by this website was issued for a different website's address."

Solutions I tried

Now this is perfectly natural in case of IE8 and self-signing certificates so I took the following measures to no use

  1. Manually added/installed the certificate as a Trusted Root Certificate in IE. But it doesn't get shown in the list, but it gets successfully added to all other tabs i.e. "Trusted Root Publisher", "Intermediate Publisher Authority", "Other People".
  2. The same certificate gets added to Firefox without any problems under "servers" and works just as expected.
  3. I tried using the following codes but one of them worked for Selenium

    Proxy proxy = new Proxy();
    proxy.setProxyType(ProxyType.MANUAL);
    Proxy.setSslProxy("trustAllSSLCertificates");
    DesiredCapabilities capabilities1 = DesiredCapabilities.internetExplorer();
    capabilities1.setCapability(CapabilityType.PROXY, proxy);
    

    When this doesn't work I tried using

    DesiredCapabilities capabilities = new DesiredCapabilities();                
    capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); 
    

    I have the Cybervillains SSL certificate already installed.

  4. I have tried the [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_ERROR_PAGE_BYPASS_ZONE_CHECK_FOR_HTTPS_KB954312][1] method knowing full well it is for Win7.
  5. I have even tried changing the URL to the issued authority but even then the problem persists.

And now I am stuck with no alternatives. Can anyone point it out to me how I can proceed? It seems I'm eternally stuck with IE8.

I have searched a lot in Google as well as in this site. But couldn't find a solution to my problem.

1
  • At this point is XP the only OS you have issues with? Most of my testing is done on Windows 2008 or later and we don't get this problem with that configuration, maybe its an XP problem
    – MichaelF
    Apr 1, 2013 at 12:11

5 Answers 5

8

I have this code running always when I instance IE8 on my tests. Works fine for me.

#region SSL workaround for IE
if (driver.GetType() == typeof(InternetExplorerDriver) && driver.Title.Contains("Certificate"))
    driver.Navigate().GoToUrl("javascript:document.getElementById('overridelink').click()");
#endregion
0

Ran into a similar problem and it turned out to be an issue with how the certificate was generated on the web server. Check out this blog post: http://blogs.atlassian.com/2007/06/ie7_on_vista_and_ssl

2
  • 1
    It'd be very weird if I have to tell the developer team to regenerate the certificate using rsa.... Isn't there any other way to get around this? Jun 15, 2012 at 8:18
  • I also found the linked blog post confusing. It says "IE7 on Vista does not like the SHA1 certifcate signature alogrithm", but SHA1 is not a signature algorithm. Perhaps what the blogger meant is that IE7 doesn't support DSA? or doesn't support SHA1withDSA signatures? It's hard to tell.
    – D.W.
    Nov 21, 2012 at 0:11
0

I hit a similar issue within our test environment and set the following for my Local Intranet Zone

  • Don't prompt for client certificate selection, Enable
  • Websites in less privileged web content zone can navigate into this zone, Enable

I also needed to make sure the Certificate was set in the Intermediate Certification Authorities.

And within the Advanced Options in Internet Options I needed to set:

  • Check for server certificate revocation - off
  • Check for publisher's certificate revocation - off
  • Warn about certficate address mismatch - off
  • Warn if changing between secure and not secure mode - off

I doubt you need all of these, and at this point I could probably go back and make my browser a bit more secure on my test environment, but we spent a long time trying to get IE to work with our certificate and at the end of the day these were the settings that finally let me get in without blocking the automation.

I do use the WebDriver for .Net but I'd imagine you could find a similar set of options that work for you on the browser. I tried the third-party add-ons to ignore the certificates but they only worked for me on FireFox and not for IE.

1
  • I have all these settings already in place, but I still can't sol;ve it. I even installed the custom cybervillanis certificate, but can't solve it. Jul 16, 2012 at 15:13
0

Is it possible to use a non-self-signed certificate? You'll need to:

  1. Run a Certification Authority on an available server.
  2. Install the root certificate on your workstation.
  3. Have the certification authority issue a certificate to your website's test server.

That's the solution we use in-house: it simulates more accurately the real-life setup, and is more convenient when we build new test servers (because every workstation only needs to install the one root certificate).

1
  • We already have a CA installed and run on a available server/ and the root certi installed in workstations. The problem is the test site is accessed through S2S Direct connectivity in which case it bypasses our local internet server and hence the Certification Authority... Presently we are trying to get the root certificate from the dev. But teh ans you gave seemed the right approach only if we could route this through our normal server. Nov 28, 2012 at 4:58
0

Try the below alternate solution, if the above "certificate installation" process is not helpful. In my case, it was not helpful because of some client restricted settings on my machine. So i used below lines in my Webdriver code.

driver.get(baseUrl");
driver.findElement(By.name("overridelink")).sendKeys(Keys.ENTER);

//The above line is for clicking "Continue to this website(not recommended)" link.

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.