42. SSL Certificates, Custom Profiles & Proxy Configurations

Handling Insecure SSL Certificates & Proxies

import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.Proxy;

ChromeOptions options = new ChromeOptions();

// Bypass self-signed SSL certificate warnings:
options.setAcceptInsecureCerts(true);

// Configure corporate HTTP Proxy:
Proxy proxy = new Proxy();
proxy.setHttpProxy("proxy.corp.internal:8080");
options.setProxy(proxy);

WebDriver driver = new ChromeDriver(options);

Task

  • Implement enableInsecureCerts:
  • 1. Accept ChromeOptions options.
  • 2. Call options.setAcceptInsecureCerts(true) and return options.
πŸ’‘Common doubts
Did you like the problem?
Lesson 42 of 44
Java
Loading code editor…
Next