2

I am running my test case using browsermob proxy.I am running my test case in selenium grid.Using Browsermob proxy i am getting ssl error.

When I am running the test on chrome, Chrome shows unsecured massage.

For Firefox, it shows Potential Security Risk Ahead

enter image description here

Here is my code

        nodeUrl = Configuration.dockerurl;
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setBrowserName(Configuration.browsername);
        capabilities.setPlatform(Platform.getCurrent());
        proxy = getProxyServer(); //getting browsermob proxy
        Proxy seleniumProxy = getSeleniumProxy(proxy);
        capabilities.setCapability(CapabilityType.PROXY, seleniumProxy);
        capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
        proxy.setHostNameResolver(ClientUtil.createDnsJavaResolver());
        driver = new RemoteWebDriver(new URL(nodeUrl), capabilities);
        proxy.setHarCaptureTypes(CaptureType.REQUEST_HEADERS, CaptureType.RESPONSE_HEADERS);

        driver.get("https://www.google.com")
        //Rest of the code here
Zakaria Shahed
  • 2,059
  • 3
  • 16
  • 39
  • Are you using the latest BrowserMobProxy and did you follow the instructions at https://github.com/lightbody/browsermob-proxy/blob/master/mitm/README.md? There are constantly new browser countermeasures to avoid SSL man-in-the-middle attacks. – Jens Dibbern Apr 05 '19 at 07:22
  • Yes I am using the latest version with given instruction – Zakaria Shahed Apr 05 '19 at 09:01
  • 1
    You could follow https://github.com/lightbody/browsermob-proxy/issues/799 or post your own issue. This could be hard to solve because for browser developers this is basically a man-in-the-middle attack. They have to identify this as a security issue. – Jens Dibbern Apr 05 '19 at 10:34

1 Answers1

3

You could adjust the profile to completely ignore SSL warnings :)

FirefoxProfile profile=new FirefoxProfile();
profile.setAcceptUntrustedCertificates(true);
David J
  • 1,376
  • 1
  • 12
  • 20