Thursday, August 2, 2012

By Pass ssl security pages

Certificates are of mainly two types
1) Self signed
2) Signed by root certificate authority.

In the case of all browsers, security certificate warning page will only be shown for pages with self signed certificate(or if certificate signed by root authority has expired).

For firefox to by pass this page we can follow two methods
1) Use a profile in which the certificate has already been installed.
2) Create a new profile and use the functions
    a) setAcceptUntrustedCertificates(Boolean value)
    b) setAssumeUntrustedCertificateIssuer(Boolean value)
      
   setAssumeUntrustedCertificateIssuer will have boolean value true or false based on the whether it is self signed or not.
        If it is self signed certicate use setAssumeUntrustedCertificateIssuer(true)
        If it the certificate has expired use setAssumeUntrustedCertificateIssuer(false) and in both of above cases setAcceptUntrustedCertificates(true) should be used.


For IE
 1) Install the certificate and run tests. If that case is failing go for second option.
 2) Use driver.navigate().to("javascript:document.getElementById('overridelink').click()"); to bypass security certificate page.

I haven't tried it for Chrome.

No comments:

Post a Comment