Unable to access unsecured https with selenium using browsermob proxy -


i'm trying embed browsermob proxy selenium (chrome) framework ui automated testing in order intercept responses , other networking.

description :

selenium webdriver using browsermob proxy , works fine - http , secured https url's ok. when i'm trying navigate unsecured https url chrome error: err_tunnel_connection_failed

here's python code:

class browser(object):     display = none     browser = none      def __init__(self, implicitly_wait_seconds=10, is_visible=true, display_size=none, browser_name='chrome'):         if not is_visible:             self.display = display(display_size)         self.server = server('/home/erez/downloads/browsermob-proxy-2.1.4/bin/browsermob-proxy')         self.server.start()         self.proxy = self.server.create_proxy()         self.capabilities = desiredcapabilities.chrome         self.proxy.add_to_capabilities(self.capabilities)         self.proxy.new_har("test", options={'captureheaders': true, 'capturecontent': true})         self.start_browser(display_size, implicitly_wait_seconds, browser_name)      def __enter__(self):         return self      def __exit__(self, _type, value, trace):         self.close()      def start_browser(self, display_size, implicitly_wait_seconds=10, browser_name='chrome'):         if browser_name == 'chrome':             chrome_options = options()             # chrome_options.add_argument("--disable-extensions")             chrome_options.add_experimental_option("excludeswitches", ["ignore-certificate-errors"])             chrome_options.add_argument("--ssl-version-max")             chrome_options.add_argument("--start-maximized")             chrome_options.add_argument('--proxy-server=%s' % self.proxy.proxy)             chrome_options.add_argument('--ignore-certificate-errors')             chrome_options.add_argument('--allow-insecure-localhost')             chrome_options.add_argument('--ignore-urlfetcher-cert-requests')             self.browser = webdriver.chrome(os.path.dirname(os.path.realpath(__file__)) + "/chromedriver",                                             chrome_options=chrome_options, desired_capabilities=self.capabilities)             self.browser.implicitly_wait(implicitly_wait_seconds) 

i faced same problem ssl proxying using browsermob proxy. have install certificate in browser has been defined in link

go bottom of document, , see section called "ssl support". install ca-certificate-rsa.cer in browser , there no issue in ssl proxying anymore.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -