Browsermob: how to accept https traffic

3k Views Asked by At

I use browsermob-proxy-2.1.0-beta-4-bin, and when I create an instance, I can view only HTTP-based sites. Is there any way to view HTTPS-sites?

2

There are 2 best solutions below

1
On

The 2.1.0-beta-4 build of Browsermob Proxy definitely supports https. I am using it right now integrate with automated browser testing. I am able to send https traffic through the proxy, capture said traffic with request/response handlers, and they appear in the HAR files when I dump them.

If you want a more specific answer, you will need to provide more details on what you are doing. What browser? How are you using it? Are you unable to get a web page to the browser, or just unable to capture the traffic in the proxy? Can your browser make direct connections to the https sites without the proxy? Are you getting errors to timeouts?

If you are manually configuring a browser to proxy through a stand-alone version of Browsermob Proxy and the page requests are failing, then it may be that your secure traffic is not going to the proxy, or that your browser is freaked out about the proxy playing man-in-the-middle. Or maybe there is a firewall interfering with the proxy reaching the https site.

0
On

@Brian S.

I am also facing the same issue.

Let me answer the questions u asked above.. 1. I am using ChromeBrowser.

2.

proxy = new BrowserMobProxyServer();
 proxy.start(0);
 Proxy seleniumProxy = ClientUtil.createSeleniumProxy(proxy);
 DesiredCapabilities capabilities = new DesiredCapabilities();
 capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, seleniumProxy);
  capabilities.setCapability(CapabilityType.PROXY, seleniumProxy);
  System.setProperty("webdriver.chrome.driver", "chromedriverpath");
  driver = new ChromeDriver(capabilities);
  proxy.enableHarCaptureTypes(CaptureType.REQUEST_HEADERS,     CaptureType.RESPONSE_HEADERS);
  proxy.newHar("URL");
 driver.manage().window().maximize();
 driver.get("URL");  
 driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
 Robot rb = new Robot();
 rb.keyPress(KeyEvent.VK_ENTER);
  1. Yes i am unable to get the web page to the browser coz of https, if change it to http the page loads.
  2. yes my browser makes direct connections to the https sites without the proxy.
  3. yes i am getting this error for https - This site can’t be reached - The webpage at URL might be temporarily down or it may have moved permanently to a new web address.ERR_TUNNEL_CONNECTION_FAILED