What is SSL Certificate?
Types of SSL Certificate Error:
SSL Certificate Error Handling in Firefox:
SSL Certificate Error Handling in Chrome:
SSL Certificate Error Handling in Internet explorer :
SSL (Secure Sockets Layer) is a standard technology to establish encrypted connection between the server and the client which is a browser.
SSL-secured websites begin with https:// and you can see a lock icon or green address bar if the connection is securely established.
What is untrusted certificate?
This is the error presented by web browsers when you access a site that has a security certificate installed (for SSL/TLS data encryption) that cannot be verified by the browser.
Types of SSL Certificate Error:
- Firefox: This connection is untrusted.
- Google Chrome: This site security is not trusted.
- Internet Explorer : This security certificate presented by this website was not trusted by a trusted certificate authority (CA).
SSL Certificate Error Handling in Firefox:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxProfile; public class Demo { public static void main(String[] args) { System.setProperty("webdriver.gecko.driver", "./ProjectSelenium/driver/geckodriver.exe"); // Creating a custom profile in Firefox to accept untrusted SSL cert FirefoxProfile profile = new FirefoxProfile(); profile.setAcceptUntrustedCertificates(true); profile.setAssumeUntrustedCertificateIssuer(false); WebDriver driver = new FirefoxDriver(profile); driver.get("https://cacert.org/"); } } |
SSL Certificate Error Handling in Chrome:
1 2 3 4 | DesiredCapabilities DC = DesiredCapabilities.chrome(); DC.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); System.setProperty("webdriver.chrome.driver","chromedriver.exe"); WebDriver driver = new ChromeDriver(DC); |
SSL Certificate Error Handling in Internet explorer :
1 2 3 4 | DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); System.setProperty("webdriver.ie.driver","IEDriverServer.exe"); WebDriver driver = new InternetExplorerDriver(capabilities); |
No comments:
Post a Comment